]> git.parisson.com Git - pdf.js.git/commitdiff
add liveprogramming as load test
authornotmasteryet <async.processingjs@yahoo.com>
Tue, 10 Jan 2012 02:37:39 +0000 (20:37 -0600)
committernotmasteryet <async.processingjs@yahoo.com>
Tue, 10 Jan 2012 02:37:39 +0000 (20:37 -0600)
test/driver.js
test/pdfs/liveprogramming.pdf.link [new file with mode: 0644]
test/test_manifest.json

index 85d25658a2537991c1d7976c8ba3b9d3b32eecaf..5a3263bdabffdb53341949e8c531b7062c05cda7 100644 (file)
@@ -78,6 +78,14 @@ function cleanup() {
   }
 }
 
+function exceptionToString(e) {
+  if (typeof e !== 'object')
+    return String(e);
+  if (!('message' in e))
+    return JSON.stringify(e);
+  return e.message + ('stack' in e ? ' at ' + e.stack.split('\n')[0] : '');
+}
+
 function nextTask() {
   cleanup();
 
@@ -95,7 +103,7 @@ function nextTask() {
     try {
       task.pdfDoc = new PDFJS.PDFDoc(data);
     } catch (e) {
-      failure = 'load PDF doc : ' + e.toString();
+      failure = 'load PDF doc : ' + exceptionToString(e);
     }
     task.pageNum = task.firstPage || 1;
     nextPage(task, failure);
@@ -185,7 +193,7 @@ function nextPage(task, loadError) {
         textLayerBuilder
       );
     } catch (e) {
-      failure = 'page setup : ' + e.toString();
+      failure = 'page setup : ' + exceptionToString(e);
     }
   }
 
diff --git a/test/pdfs/liveprogramming.pdf.link b/test/pdfs/liveprogramming.pdf.link
new file mode 100644 (file)
index 0000000..390da08
--- /dev/null
@@ -0,0 +1 @@
+http://blog.lassus.se/files/liveprogramming.pdf
index 7954aa09417dc6f7ee11171421dca1e104cbdf99..628fcb52c591bc2a5efda377df8552191bfe0dd1 100644 (file)
       "rounds": 1,
       "link": true,
       "type": "eq"
+    },
+    {  "id": "liveprogramming",
+      "file": "pdfs/liveprogramming.pdf",
+      "md5": "7bd4dad1188232ef597d36fd72c33e52",
+      "rounds": 1,
+      "pageLimit": 3,
+      "link": true,
+      "type": "load"
     }
 ]