Skip to content

Commit

Permalink
Using pre-built code for testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
yurydelendik committed May 30, 2017
1 parent 263479f commit 914b0ad
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 27 deletions.
12 changes: 6 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1055,34 +1055,34 @@ 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');
});

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);
});

Expand Down
1 change: 1 addition & 0 deletions src/main_loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,5 @@
displayDOMUtils.RenderingCancelledException;
exports.getFilenameFromUrl = displayDOMUtils.getFilenameFromUrl;
exports.addLinkAttributes = displayDOMUtils.addLinkAttributes;
exports.StatTimer = sharedUtil.StatTimer;
}));
1 change: 1 addition & 0 deletions src/pdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ exports.RenderingCancelledException =
pdfjsDisplayDOMUtils.RenderingCancelledException;
exports.getFilenameFromUrl = pdfjsDisplayDOMUtils.getFilenameFromUrl;
exports.addLinkAttributes = pdfjsDisplayDOMUtils.addLinkAttributes;
exports.StatTimer = pdfjsSharedUtil.StatTimer;
8 changes: 5 additions & 3 deletions test/driver.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 () {
Expand Down
24 changes: 7 additions & 17 deletions test/test_slave.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
<head>
<title>PDF.js test slave</title>
<meta charset="utf-8">
<script src="../node_modules/systemjs/dist/system.js"></script>
<script src="../systemjs.config.js"></script>
<script src="../build/generic/build/pdf.js"></script>
<script src="driver.js"></script>
</head>
<body>
Expand All @@ -32,21 +31,12 @@
<div id="end"></div>
</body>
<script>
Promise.all([SystemJS.import('pdfjs/display/api'),
SystemJS.import('pdfjs/display/text_layer'),
SystemJS.import('pdfjs/display/annotation_layer'),
SystemJS.import('pdfjs/display/global'),
SystemJS.import('pdfjs/shared/util')])
.then(function (modules) {
window.pdfjsSharedUtil = modules[4];

var driver = new Driver({
disableScrolling: document.getElementById('disableScrolling'),
inflight: document.getElementById('inflight'),
output: document.getElementById('output'),
end: document.getElementById('end')
});
driver.run();
var driver = new Driver({
disableScrolling: document.getElementById('disableScrolling'),
inflight: document.getElementById('inflight'),
output: document.getElementById('output'),
end: document.getElementById('end')
});
driver.run();
</script>
</html>
2 changes: 1 addition & 1 deletion test/unit/jasmine-boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 914b0ad

Please sign in to comment.