1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Enable running the cmap unit-tests on Travis by utilizing a NodeCMapReaderFactory

This commit is contained in:
Jonas Jenwald 2017-02-17 13:44:49 +01:00
parent cfaa621a05
commit 9082f08e37
5 changed files with 108 additions and 20 deletions

View file

@ -12,7 +12,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals process, __pdfjsdev_webpack__ */
'use strict';
@ -46,6 +45,7 @@ var error = sharedUtil.error;
var info = sharedUtil.info;
var warn = sharedUtil.warn;
var setVerbosityLevel = sharedUtil.setVerbosityLevel;
var isNodeJS = sharedUtil.isNodeJS;
var Ref = corePrimitives.Ref;
var LocalPdfManager = corePdfManager.LocalPdfManager;
var NetworkPdfManager = corePdfManager.NetworkPdfManager;
@ -1007,14 +1007,6 @@ function initializeWorker() {
handler.send('ready', null);
}
function isNodeJS() {
// The if below protected by __pdfjsdev_webpack__ check from webpack parsing.
if (typeof __pdfjsdev_webpack__ === 'undefined') {
return typeof process === 'object' && process + '' === '[object process]';
}
return false;
}
// Worker thread (and not node.js)?
if (typeof window === 'undefined' && !isNodeJS()) {
initializeWorker();