]> git.parisson.com Git - pdf.js.git/commitdiff
Fix the text layer testing
authornotmasteryet <async.processingjs@yahoo.com>
Sun, 18 Dec 2011 22:15:53 +0000 (16:15 -0600)
committernotmasteryet <async.processingjs@yahoo.com>
Sun, 18 Dec 2011 22:15:53 +0000 (16:15 -0600)
test/driver.js

index 64fceee90d52c34ea461d77031c104abc6a77c45..85d25658a2537991c1d7976c8ba3b9d3b32eecaf 100644 (file)
@@ -165,9 +165,14 @@ function nextPage(task, loadError) {
       canvas.height = pageHeight * pdfToCssUnitsCoef;
       clear(ctx);
 
-      // using non-attached to the document div to test
+      // using the text layer builder that does nothing to test
       // text layer creation operations
-      var textLayer = document.createElement('div');
+      var textLayerBuilder = {
+        beginLayout: function nullTextLayerBuilderBeginLayout() {},
+        endLayout: function nullTextLayerBuilderEndLayout() {},
+        appendText: function nullTextLayerBuilderAppendText(text, fontName,
+                                                            fontSize) {}
+      };
 
       page.startRendering(
         ctx,
@@ -177,7 +182,7 @@ function nextPage(task, loadError) {
             failureMessage = 'render : ' + error.message;
           snapshotCurrentPage(task, failureMessage);
         },
-        textLayer
+        textLayerBuilder
       );
     } catch (e) {
       failure = 'page setup : ' + e.toString();