Skip to content

Commit

Permalink
Hack to avoid intermidiate Chrome failures during tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
yurydelendik committed Dec 29, 2015
1 parent 2f8ae38 commit 2b2c521
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/display/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -1253,7 +1253,16 @@ var PDFWorker = (function PDFWorkerClosure() {
// https://bugzilla.mozilla.org/show_bug.cgi?id=683280
var worker = new Worker(workerSrc);
var messageHandler = new MessageHandler('main', 'worker', worker);
//#if !PRODUCTION
// Don't allow worker to be destroyed by Chrome, see:
// https://code.google.com/p/chromium/issues/detail?id=572225
var jsWorkerId = '_workerKungfuGrip_' + Math.random();
window[jsWorkerId] = worker;
//#endif
messageHandler.on('test', function PDFWorker_test(data) {
//#if !PRODUCTION
delete window[jsWorkerId];
//#endif
if (this.destroyed) {
this._readyCapability.reject(new Error('Worker was destroyed'));
messageHandler.destroy();
Expand Down

0 comments on commit 2b2c521

Please sign in to comment.