mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Enable running the cmap
unit-tests on Travis by utilizing a NodeCMapReaderFactory
This commit is contained in:
parent
cfaa621a05
commit
9082f08e37
5 changed files with 108 additions and 20 deletions
|
@ -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();
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals global */
|
||||
/* globals global, process, __pdfjsdev_webpack__ */
|
||||
|
||||
'use strict';
|
||||
|
||||
|
@ -1136,6 +1136,14 @@ function isSpace(ch) {
|
|||
return (ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Promise Capability object.
|
||||
*
|
||||
|
@ -2454,6 +2462,7 @@ exports.isInt = isInt;
|
|||
exports.isNum = isNum;
|
||||
exports.isString = isString;
|
||||
exports.isSpace = isSpace;
|
||||
exports.isNodeJS = isNodeJS;
|
||||
exports.isSameOrigin = isSameOrigin;
|
||||
exports.createValidAbsoluteUrl = createValidAbsoluteUrl;
|
||||
exports.isLittleEndian = isLittleEndian;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue