From: notmasteryet Date: Sun, 18 Dec 2011 22:15:53 +0000 (-0600) Subject: Fix the text layer testing X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=a52aacab5a8925350e3208a575080f243ff48ccf;p=pdf.js.git Fix the text layer testing --- diff --git a/test/driver.js b/test/driver.js index 64fceee..85d2565 100644 --- a/test/driver.js +++ b/test/driver.js @@ -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();