From b66b705ed7125fa008e3f067b2d3fd8ee11170b2 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Tue, 30 May 2017 10:28:50 -0500 Subject: [PATCH] Using pre-built code for testing. --- gulpfile.js | 12 ++++++------ src/main_loader.js | 1 + src/pdf.js | 1 + test/driver.js | 8 +++++--- test/test_slave.html | 24 +++++++----------------- test/unit/jasmine-boot.js | 2 +- 6 files changed, 21 insertions(+), 27 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 20e819b2b..764cac4a6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1055,22 +1055,22 @@ gulp.task('publish', ['generic'], function (done) { }); }); -gulp.task('test', function () { +gulp.task('test', ['generic'], function () { return streamqueue({ objectMode: true }, createTestSource('unit'), createTestSource('browser')); }); -gulp.task('bottest', function () { +gulp.task('bottest', ['generic'], function () { return streamqueue({ objectMode: true }, createTestSource('unit'), createTestSource('font'), createTestSource('browser (no reftest)')); }); -gulp.task('browsertest', function () { +gulp.task('browsertest', ['generic'], function () { return createTestSource('browser'); }); -gulp.task('unittest', function () { +gulp.task('unittest', ['generic'], function () { return createTestSource('unit'); }); @@ -1078,11 +1078,11 @@ gulp.task('fonttest', function () { return createTestSource('font'); }); -gulp.task('makeref', function (done) { +gulp.task('makeref', ['generic'], function (done) { makeRef(done); }); -gulp.task('botmakeref', function (done) { +gulp.task('botmakeref', ['generic'], function (done) { makeRef(done, true); }); diff --git a/src/main_loader.js b/src/main_loader.js index 9529bc61a..e9512cd2e 100644 --- a/src/main_loader.js +++ b/src/main_loader.js @@ -68,4 +68,5 @@ displayDOMUtils.RenderingCancelledException; exports.getFilenameFromUrl = displayDOMUtils.getFilenameFromUrl; exports.addLinkAttributes = displayDOMUtils.addLinkAttributes; + exports.StatTimer = sharedUtil.StatTimer; })); diff --git a/src/pdf.js b/src/pdf.js index 8389f8b81..f5ad9a2b2 100644 --- a/src/pdf.js +++ b/src/pdf.js @@ -57,3 +57,4 @@ exports.RenderingCancelledException = pdfjsDisplayDOMUtils.RenderingCancelledException; exports.getFilenameFromUrl = pdfjsDisplayDOMUtils.getFilenameFromUrl; exports.addLinkAttributes = pdfjsDisplayDOMUtils.addLinkAttributes; +exports.StatTimer = pdfjsSharedUtil.StatTimer; diff --git a/test/driver.js b/test/driver.js index 281d61e2c..d0d8642a2 100644 --- a/test/driver.js +++ b/test/driver.js @@ -12,13 +12,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -/* globals PDFJS, pdfjsSharedUtil */ +/* globals PDFJS, pdfjsDistBuildPdf */ 'use strict'; var WAITING_TIME = 100; // ms var PDF_TO_CSS_UNITS = 96.0 / 72.0; +var StatTimer = pdfjsDistBuildPdf.StatTimer; + /** * @class */ @@ -258,7 +260,7 @@ var Driver = (function DriverClosure() { // eslint-disable-line no-unused-vars */ function Driver(options) { // Configure the global PDFJS object - PDFJS.workerSrc = '../src/worker_loader.js'; + PDFJS.workerSrc = '../build/generic/build/pdf.worker.js'; PDFJS.cMapPacked = true; PDFJS.cMapUrl = '../external/bcmaps/'; PDFJS.enableStats = true; @@ -547,7 +549,7 @@ var Driver = (function DriverClosure() { // eslint-disable-line no-unused-vars } page.cleanup(); task.stats = page.stats; - page.stats = new pdfjsSharedUtil.StatTimer(); + page.stats = new StatTimer(); self._snapshot(task, error); }); initPromise.then(function () { diff --git a/test/test_slave.html b/test/test_slave.html index c40bdabf5..0b8027546 100644 --- a/test/test_slave.html +++ b/test/test_slave.html @@ -18,8 +18,7 @@ limitations under the License. PDF.js test slave - - + @@ -32,21 +31,12 @@ limitations under the License.
diff --git a/test/unit/jasmine-boot.js b/test/unit/jasmine-boot.js index d96521b2e..00bb0768d 100644 --- a/test/unit/jasmine-boot.js +++ b/test/unit/jasmine-boot.js @@ -60,7 +60,7 @@ function initializePDFJS(callback) { var displayGlobal = modules[0]; // Configure the worker. - displayGlobal.PDFJS.workerSrc = '../../src/worker_loader.js'; + displayGlobal.PDFJS.workerSrc = '../../build/generic/build/pdf.worker.js'; // Opt-in to using the latest API. displayGlobal.PDFJS.pdfjsNext = true;