Merge pull request #8298 from timvandermeij/es6-modules-test
Convert the files in the `/test/unit` folder to ES6 modules
This commit is contained in:
commit
00d67371ec
@ -12,42 +12,17 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import {
|
||||||
if (typeof define === 'function' && define.amd) {
|
Annotation, AnnotationBorderStyle, AnnotationFactory
|
||||||
define('pdfjs-test/unit/annotation_spec', ['exports',
|
} from '../../src/core/annotation';
|
||||||
'pdfjs/core/primitives', 'pdfjs/core/annotation', 'pdfjs/core/stream',
|
import {
|
||||||
'pdfjs/core/parser', 'pdfjs/shared/util'], factory);
|
AnnotationBorderStyleType, AnnotationFieldFlag, AnnotationFlag,
|
||||||
} else if (typeof exports !== 'undefined') {
|
AnnotationType, stringToBytes, stringToUTF8String
|
||||||
factory(exports, require('../../src/core/primitives.js'),
|
} from '../../src/shared/util';
|
||||||
require('../../src/core/annotation.js'),
|
import { Dict, isRef, Name, Ref } from '../../src/core/primitives';
|
||||||
require('../../src/core/stream.js'), require('../../src/core/parser.js'),
|
import { Lexer, Parser } from '../../src/core/parser';
|
||||||
require('../../src/shared/util.js'));
|
import { StringStream } from '../../src/core/stream';
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitAnnotationSpec = {}),
|
|
||||||
root.pdfjsCorePrimitives, root.pdfjsCoreAnnotation, root.pdfjsCoreStream,
|
|
||||||
root.pdfjsCoreParser, root.pdfjsSharedUtil);
|
|
||||||
}
|
|
||||||
}(this, function (exports, corePrimitives, coreAnnotation, coreStream,
|
|
||||||
coreParser, sharedUtil) {
|
|
||||||
|
|
||||||
var Annotation = coreAnnotation.Annotation;
|
|
||||||
var AnnotationBorderStyle = coreAnnotation.AnnotationBorderStyle;
|
|
||||||
var AnnotationFactory = coreAnnotation.AnnotationFactory;
|
|
||||||
var Lexer = coreParser.Lexer;
|
|
||||||
var Parser = coreParser.Parser;
|
|
||||||
var isRef = corePrimitives.isRef;
|
|
||||||
var Dict = corePrimitives.Dict;
|
|
||||||
var Name = corePrimitives.Name;
|
|
||||||
var Ref = corePrimitives.Ref;
|
|
||||||
var StringStream = coreStream.StringStream;
|
|
||||||
var AnnotationType = sharedUtil.AnnotationType;
|
|
||||||
var AnnotationFlag = sharedUtil.AnnotationFlag;
|
|
||||||
var AnnotationBorderStyleType = sharedUtil.AnnotationBorderStyleType;
|
|
||||||
var AnnotationFieldFlag = sharedUtil.AnnotationFieldFlag;
|
|
||||||
var stringToBytes = sharedUtil.stringToBytes;
|
|
||||||
var stringToUTF8String = sharedUtil.stringToUTF8String;
|
|
||||||
|
|
||||||
describe('annotation', function() {
|
describe('annotation', function() {
|
||||||
function XRefMock(array) {
|
function XRefMock(array) {
|
||||||
@ -1393,4 +1368,3 @@ describe('annotation', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,37 +12,16 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import {
|
||||||
if (typeof define === 'function' && define.amd) {
|
createPromiseCapability, FontType, InvalidPDFException, MissingPDFException,
|
||||||
define('pdfjs-test/unit/api_spec', ['exports', 'pdfjs/shared/util',
|
PasswordException, PasswordResponses, StreamType
|
||||||
'pdfjs/display/dom_utils', 'pdfjs/display/global', 'pdfjs/display/api'],
|
} from '../../src/shared/util';
|
||||||
factory);
|
import {
|
||||||
} else if (typeof exports !== 'undefined') {
|
DOMCanvasFactory, RenderingCancelledException
|
||||||
factory(exports, require('../../src/shared/util.js'),
|
} from '../../src/display/dom_utils';
|
||||||
require('../../src/display/dom_utils.js'),
|
import { PDFDocumentProxy, PDFPageProxy } from '../../src/display/api';
|
||||||
require('../../src/display/global.js'),
|
import { PDFJS } from '../../src/display/global';
|
||||||
require('../../src/display/api.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitApiSpec = {}), root.pdfjsSharedUtil,
|
|
||||||
root.pdfjsDisplayDOMUtils, root.pdfjsDisplayGlobal, root.pdfjsDisplayApi);
|
|
||||||
}
|
|
||||||
}(this, function (exports, sharedUtil, displayDOMUtils, displayGlobal,
|
|
||||||
displayApi) {
|
|
||||||
|
|
||||||
var PDFJS = displayGlobal.PDFJS;
|
|
||||||
var createPromiseCapability = sharedUtil.createPromiseCapability;
|
|
||||||
var DOMCanvasFactory = displayDOMUtils.DOMCanvasFactory;
|
|
||||||
var RenderingCancelledException = displayDOMUtils.RenderingCancelledException;
|
|
||||||
var PDFDocumentProxy = displayApi.PDFDocumentProxy;
|
|
||||||
var InvalidPDFException = sharedUtil.InvalidPDFException;
|
|
||||||
var MissingPDFException = sharedUtil.MissingPDFException;
|
|
||||||
var PasswordResponses = sharedUtil.PasswordResponses;
|
|
||||||
var PasswordException = sharedUtil.PasswordException;
|
|
||||||
var PDFPageProxy = displayApi.PDFPageProxy;
|
|
||||||
var StreamType = sharedUtil.StreamType;
|
|
||||||
var FontType = sharedUtil.FontType;
|
|
||||||
|
|
||||||
describe('api', function() {
|
describe('api', function() {
|
||||||
var basicApiUrl = new URL('../pdfs/basicapi.pdf', window.location).href;
|
var basicApiUrl = new URL('../pdfs/basicapi.pdf', window.location).href;
|
||||||
@ -1210,4 +1189,3 @@ describe('api', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,20 +12,8 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import { bidi } from '../../src/core/bidi';
|
||||||
if (typeof define === 'function' && define.amd) {
|
|
||||||
define('pdfjs-test/unit/bidi_spec', ['exports', 'pdfjs/core/bidi'],
|
|
||||||
factory);
|
|
||||||
} else if (typeof exports !== 'undefined') {
|
|
||||||
factory(exports, require('../../src/core/bidi.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitBidiSpec = {}), root.pdfjsCoreBidi);
|
|
||||||
}
|
|
||||||
}(this, function (exports, coreBidi) {
|
|
||||||
|
|
||||||
var bidi = coreBidi.bidi;
|
|
||||||
|
|
||||||
describe('bidi', function () {
|
describe('bidi', function () {
|
||||||
it('should mark text as RTL if more than 30% of text is RTL', function() {
|
it('should mark text as RTL if more than 30% of text is RTL', function() {
|
||||||
@ -47,4 +35,3 @@ describe('bidi', function () {
|
|||||||
expect(bidiText.dir).toEqual('ltr');
|
expect(bidiText.dir).toEqual('ltr');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,29 +12,12 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import {
|
||||||
if (typeof define === 'function' && define.amd) {
|
CFFCompiler, CFFIndex, CFFParser, CFFStrings
|
||||||
define('pdfjs-test/unit/cff_parser_spec', ['exports',
|
} from '../../src/core/cff_parser';
|
||||||
'pdfjs/core/cff_parser', 'pdfjs/core/fonts',
|
import { SEAC_ANALYSIS_ENABLED } from '../../src/core/fonts';
|
||||||
'pdfjs/core/stream'], factory);
|
import { Stream } from '../../src/core/stream';
|
||||||
} else if (typeof exports !== 'undefined') {
|
|
||||||
factory(exports, require('../../src/core/cff_parser.js'),
|
|
||||||
require('../../src/core/fonts.js'),
|
|
||||||
require('../../src/core/stream.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitCFFParserSpec = {}), root.pdfjsCoreCFFParser,
|
|
||||||
root.pdfjsCoreFonts, root.pdfjsCoreStream);
|
|
||||||
}
|
|
||||||
}(this, function (exports, coreCFFParser, coreFonts, coreStream) {
|
|
||||||
|
|
||||||
var CFFParser = coreCFFParser.CFFParser;
|
|
||||||
var CFFIndex = coreCFFParser.CFFIndex;
|
|
||||||
var CFFStrings = coreCFFParser.CFFStrings;
|
|
||||||
var CFFCompiler = coreCFFParser.CFFCompiler;
|
|
||||||
var SEAC_ANALYSIS_ENABLED = coreFonts.SEAC_ANALYSIS_ENABLED;
|
|
||||||
var Stream = coreStream.Stream;
|
|
||||||
|
|
||||||
describe('CFFParser', function() {
|
describe('CFFParser', function() {
|
||||||
function createWithNullProto(obj) {
|
function createWithNullProto(obj) {
|
||||||
@ -388,4 +371,3 @@ describe('CFFCompiler', function() {
|
|||||||
|
|
||||||
// TODO a lot more compiler tests
|
// TODO a lot more compiler tests
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,36 +12,13 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import { CMap, CMapFactory, IdentityCMap } from '../../src/core/cmap';
|
||||||
if (typeof define === 'function' && define.amd) {
|
import { DOMCMapReaderFactory } from '../../src/display/dom_utils';
|
||||||
define('pdfjs-test/unit/cmap_spec', ['exports', 'pdfjs/core/cmap',
|
import { isNodeJS } from '../../src/shared/util';
|
||||||
'pdfjs/core/primitives', 'pdfjs/core/stream', 'pdfjs/display/dom_utils',
|
import { Name } from '../../src/core/primitives';
|
||||||
'pdfjs/shared/util', 'pdfjs-test/unit/test_utils'], factory);
|
import { NodeCMapReaderFactory } from './test_utils';
|
||||||
} else if (typeof exports !== 'undefined') {
|
import { StringStream } from '../../src/core/stream';
|
||||||
factory(exports, require('../../src/core/cmap.js'),
|
|
||||||
require('../../src/core/primitives.js'),
|
|
||||||
require('../../src/core/stream.js'),
|
|
||||||
require('../../src/display/dom_utils.js'),
|
|
||||||
require('../../src/shared/util.js'), require('./test_utils.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitCMapSpec = {}), root.pdfjsCoreCMap,
|
|
||||||
root.pdfjsCorePrimitives, root.pdfjsCoreStream,
|
|
||||||
root.pdfjsDisplayDOMUtils, root.pdfjsSharedUtil,
|
|
||||||
root.pdfjsTestUnitTestUtils);
|
|
||||||
}
|
|
||||||
}(this, function (exports, coreCMap, corePrimitives, coreStream,
|
|
||||||
displayDOMUtils, sharedUtil, testUnitTestUtils) {
|
|
||||||
|
|
||||||
var CMapFactory = coreCMap.CMapFactory;
|
|
||||||
var CMap = coreCMap.CMap;
|
|
||||||
var IdentityCMap = coreCMap.IdentityCMap;
|
|
||||||
var Name = corePrimitives.Name;
|
|
||||||
var StringStream = coreStream.StringStream;
|
|
||||||
var DOMCMapReaderFactory = displayDOMUtils.DOMCMapReaderFactory;
|
|
||||||
var isNodeJS = sharedUtil.isNodeJS;
|
|
||||||
var NodeCMapReaderFactory = testUnitTestUtils.NodeCMapReaderFactory;
|
|
||||||
|
|
||||||
var cMapUrl = {
|
var cMapUrl = {
|
||||||
dom: '../../external/bcmaps/',
|
dom: '../../external/bcmaps/',
|
||||||
@ -310,4 +287,3 @@ describe('cmap', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,37 +12,15 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import {
|
||||||
if (typeof define === 'function' && define.amd) {
|
AES128Cipher, AES256Cipher, ARCFourCipher, calculateMD5, calculateSHA256,
|
||||||
define('pdfjs-test/unit/crypto_spec', ['exports', 'pdfjs/core/crypto',
|
calculateSHA384, calculateSHA512, CipherTransformFactory, PDF17, PDF20
|
||||||
'pdfjs/core/primitives', 'pdfjs/shared/util'], factory);
|
} from '../../src/core/crypto';
|
||||||
} else if (typeof exports !== 'undefined') {
|
import { Dict, Name } from '../../src/core/primitives';
|
||||||
factory(exports, require('../../src/core/crypto.js'),
|
import {
|
||||||
require('../../src/core/primitives.js'),
|
PasswordException, PasswordResponses, stringToBytes
|
||||||
require('../../src/shared/util.js'));
|
} from '../../src/shared/util';
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitCryptoSpec = {}), root.pdfjsCoreCrypto,
|
|
||||||
root.pdfjsCorePrimitives, root.pdfjsSharedUtil);
|
|
||||||
}
|
|
||||||
}(this, function (exports, coreCrypto, corePrimitives, sharedUtil) {
|
|
||||||
|
|
||||||
var calculateMD5 = coreCrypto.calculateMD5;
|
|
||||||
var ARCFourCipher = coreCrypto.ARCFourCipher;
|
|
||||||
var calculateSHA256 = coreCrypto.calculateSHA256;
|
|
||||||
var calculateSHA384 = coreCrypto.calculateSHA384;
|
|
||||||
var calculateSHA512 = coreCrypto.calculateSHA512;
|
|
||||||
var AES128Cipher = coreCrypto.AES128Cipher;
|
|
||||||
var AES256Cipher = coreCrypto.AES256Cipher;
|
|
||||||
var PDF17 = coreCrypto.PDF17;
|
|
||||||
var PDF20 = coreCrypto.PDF20;
|
|
||||||
var CipherTransformFactory = coreCrypto.CipherTransformFactory;
|
|
||||||
var Name = corePrimitives.Name;
|
|
||||||
var Dict = corePrimitives.Dict;
|
|
||||||
var stringToBytes = sharedUtil.stringToBytes;
|
|
||||||
var PasswordException = sharedUtil.PasswordException;
|
|
||||||
var PasswordResponses = sharedUtil.PasswordResponses;
|
|
||||||
|
|
||||||
describe('crypto', function() {
|
describe('crypto', function() {
|
||||||
function hex2binary(s) {
|
function hex2binary(s) {
|
||||||
@ -708,4 +686,3 @@ describe('CipherTransformFactory', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,21 +12,8 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import { Page } from '../../src/core/document';
|
||||||
if (typeof define === 'function' && define.amd) {
|
|
||||||
define('pdfjs-test/unit/document_spec', ['exports', 'pdfjs/core/document'],
|
|
||||||
factory);
|
|
||||||
} else if (typeof exports !== 'undefined') {
|
|
||||||
factory(exports, require('../../src/core/document.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitDocumentSpec = {}),
|
|
||||||
root.pdfjsCoreDocument);
|
|
||||||
}
|
|
||||||
}(this, function (exports, coreDocument) {
|
|
||||||
|
|
||||||
var Page = coreDocument.Page;
|
|
||||||
|
|
||||||
describe('document', function () {
|
describe('document', function () {
|
||||||
describe('Page', function () {
|
describe('Page', function () {
|
||||||
@ -55,4 +42,3 @@ describe('document', function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,25 +12,11 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import {
|
||||||
if (typeof define === 'function' && define.amd) {
|
getFilenameFromUrl, isExternalLinkTargetSet, LinkTarget
|
||||||
define('pdfjs-test/unit/dom_utils_spec', ['exports',
|
} from '../../src/display/dom_utils';
|
||||||
'pdfjs/display/dom_utils', 'pdfjs/display/global'], factory);
|
import { PDFJS } from '../../src/display/global';
|
||||||
} else if (typeof exports !== 'undefined') {
|
|
||||||
factory(exports, require('../../src/display/dom_utils.js'),
|
|
||||||
require('../../src/display/global.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitDOMUtilsSpec = {}), root.pdfjsDisplayDOMUtils,
|
|
||||||
root.pdfjsDisplayGlobal);
|
|
||||||
}
|
|
||||||
}(this, function (exports, displayDOMUtils, displayGlobal) {
|
|
||||||
|
|
||||||
var PDFJS = displayGlobal.PDFJS;
|
|
||||||
var getFilenameFromUrl = displayDOMUtils.getFilenameFromUrl;
|
|
||||||
var LinkTarget = displayDOMUtils.LinkTarget;
|
|
||||||
var isExternalLinkTargetSet = displayDOMUtils.isExternalLinkTargetSet;
|
|
||||||
|
|
||||||
describe('dom_utils', function() {
|
describe('dom_utils', function() {
|
||||||
describe('getFilenameFromUrl', function() {
|
describe('getFilenameFromUrl', function() {
|
||||||
@ -82,4 +68,3 @@ describe('dom_utils', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,36 +12,12 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import { Dict, Name } from '../../src/core/primitives';
|
||||||
if (typeof define === 'function' && define.amd) {
|
import { OperatorList, PartialEvaluator } from '../../src/core/evaluator';
|
||||||
define('pdfjs-test/unit/evaluator_spec', ['exports',
|
import { Stream, StringStream } from '../../src/core/stream';
|
||||||
'pdfjs/core/evaluator', 'pdfjs/core/primitives',
|
import { OPS } from '../../src/shared/util';
|
||||||
'pdfjs/core/stream', 'pdfjs/core/worker',
|
import { WorkerTask } from '../../src/core/worker';
|
||||||
'pdfjs/shared/util'], factory);
|
|
||||||
} else if (typeof exports !== 'undefined') {
|
|
||||||
factory(exports, require('../../src/core/evaluator.js'),
|
|
||||||
require('../../src/core/primitives.js'),
|
|
||||||
require('../../src/core/stream.js'),
|
|
||||||
require('../../src/core/worker.js'),
|
|
||||||
require('../../src/shared/util.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitEvaluatorSpec = {}), root.pdfjsCoreEvaluator,
|
|
||||||
root.pdfjsCorePrimitives, root.pdfjsCoreStream,
|
|
||||||
root.pdfjsCoreWorker, root.pdfjsSharedUtil);
|
|
||||||
}
|
|
||||||
}(this, function (exports, coreEvaluator, corePrimitives, coreStream,
|
|
||||||
coreWorker, sharedUtil) {
|
|
||||||
|
|
||||||
var OperatorList = coreEvaluator.OperatorList;
|
|
||||||
var PartialEvaluator = coreEvaluator.PartialEvaluator;
|
|
||||||
var Dict = corePrimitives.Dict;
|
|
||||||
var Name = corePrimitives.Name;
|
|
||||||
var Stream = coreStream.Stream;
|
|
||||||
var StringStream = coreStream.StringStream;
|
|
||||||
var WorkerTask = coreWorker.WorkerTask;
|
|
||||||
var OPS = sharedUtil.OPS;
|
|
||||||
|
|
||||||
describe('evaluator', function() {
|
describe('evaluator', function() {
|
||||||
function XrefMock(queue) {
|
function XrefMock(queue) {
|
||||||
@ -361,4 +337,3 @@ describe('evaluator', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,25 +12,11 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import {
|
||||||
if (typeof define === 'function' && define.amd) {
|
PRIVATE_USE_OFFSET_END, PRIVATE_USE_OFFSET_START, ProblematicCharRanges
|
||||||
define('pdfjs-test/unit/fonts_spec', ['exports', 'pdfjs/core/fonts',
|
} from '../../src/core/fonts';
|
||||||
'pdfjs/shared/util'], factory);
|
import { isInt } from '../../src/shared/util';
|
||||||
} else if (typeof exports !== 'undefined') {
|
|
||||||
factory(exports, require('../../src/core/fonts.js'),
|
|
||||||
require('../../src/shared/util.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitFontsSpec = {}), root.pdfjsCoreFonts,
|
|
||||||
root.pdfjsSharedUtil);
|
|
||||||
}
|
|
||||||
}(this, function (exports, coreFonts, sharedUtil) {
|
|
||||||
|
|
||||||
var ProblematicCharRanges = coreFonts.ProblematicCharRanges;
|
|
||||||
var PRIVATE_USE_OFFSET_START = coreFonts.PRIVATE_USE_OFFSET_START;
|
|
||||||
var PRIVATE_USE_OFFSET_END = coreFonts.PRIVATE_USE_OFFSET_END;
|
|
||||||
var isInt = sharedUtil.isInt;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to validate the entries in `ProblematicCharRanges`, and to ensure that
|
* Used to validate the entries in `ProblematicCharRanges`, and to ensure that
|
||||||
@ -104,4 +90,3 @@ describe('Fonts', function() {
|
|||||||
expect(result.percentage).toBeLessThan(EXPECTED_PERCENTAGE);
|
expect(result.percentage).toBeLessThan(EXPECTED_PERCENTAGE);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,31 +12,13 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import {
|
||||||
if (typeof define === 'function' && define.amd) {
|
PostScriptCompiler, PostScriptEvaluator
|
||||||
define('pdfjs-test/unit/function_spec', ['exports',
|
} from '../../src/core/function';
|
||||||
'pdfjs/core/function', 'pdfjs/core/ps_parser',
|
import { PostScriptLexer, PostScriptParser } from '../../src/core/ps_parser';
|
||||||
'pdfjs/core/stream', 'pdfjs/shared/util'], factory);
|
import { isArray } from '../../src/shared/util';
|
||||||
} else if (typeof exports !== 'undefined') {
|
import { StringStream } from '../../src/core/stream';
|
||||||
factory(exports, require('../../src/core/function.js'),
|
|
||||||
require('../../src/core/ps_parser.js'),
|
|
||||||
require('../../src/core/stream.js'),
|
|
||||||
require('../../src/shared/util.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitFunctionSpec = {}),
|
|
||||||
root.pdfjsCoreFunction, root.pdfjsCorePsParser,
|
|
||||||
root.pdfjsCoreStream, root.pdfjsSharedUtil);
|
|
||||||
}
|
|
||||||
}(this, function (exports, coreFunction, corePsParser, coreStream, sharedUtil) {
|
|
||||||
|
|
||||||
var PostScriptEvaluator = coreFunction.PostScriptEvaluator;
|
|
||||||
var PostScriptCompiler = coreFunction.PostScriptCompiler;
|
|
||||||
var PostScriptParser = corePsParser.PostScriptParser;
|
|
||||||
var PostScriptLexer = corePsParser.PostScriptLexer;
|
|
||||||
var StringStream = coreStream.StringStream;
|
|
||||||
var isArray = sharedUtil.isArray;
|
|
||||||
|
|
||||||
describe('function', function() {
|
describe('function', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
@ -564,4 +546,3 @@ describe('function', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -41,30 +41,30 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
function initializePDFJS(callback) {
|
function initializePDFJS(callback) {
|
||||||
Promise.all([
|
Promise.all([
|
||||||
'pdfjs/display/global', 'pdfjs-test/unit/annotation_spec',
|
'pdfjs/display/global', 'pdfjs-test/unit/annotation_spec',
|
||||||
'pdfjs-test/unit/api_spec', 'pdfjs-test/unit/bidi_spec',
|
'pdfjs-test/unit/api_spec', 'pdfjs-test/unit/bidi_spec',
|
||||||
'pdfjs-test/unit/cff_parser_spec', 'pdfjs-test/unit/cmap_spec',
|
'pdfjs-test/unit/cff_parser_spec', 'pdfjs-test/unit/cmap_spec',
|
||||||
'pdfjs-test/unit/crypto_spec', 'pdfjs-test/unit/document_spec',
|
'pdfjs-test/unit/crypto_spec', 'pdfjs-test/unit/document_spec',
|
||||||
'pdfjs-test/unit/dom_utils_spec', 'pdfjs-test/unit/evaluator_spec',
|
'pdfjs-test/unit/dom_utils_spec', 'pdfjs-test/unit/evaluator_spec',
|
||||||
'pdfjs-test/unit/fonts_spec', 'pdfjs-test/unit/function_spec',
|
'pdfjs-test/unit/fonts_spec', 'pdfjs-test/unit/function_spec',
|
||||||
'pdfjs-test/unit/metadata_spec', 'pdfjs-test/unit/murmurhash3_spec',
|
'pdfjs-test/unit/metadata_spec', 'pdfjs-test/unit/murmurhash3_spec',
|
||||||
'pdfjs-test/unit/network_spec', 'pdfjs-test/unit/parser_spec',
|
'pdfjs-test/unit/network_spec', 'pdfjs-test/unit/parser_spec',
|
||||||
'pdfjs-test/unit/primitives_spec', 'pdfjs-test/unit/stream_spec',
|
'pdfjs-test/unit/primitives_spec', 'pdfjs-test/unit/stream_spec',
|
||||||
'pdfjs-test/unit/type1_parser_spec', 'pdfjs-test/unit/ui_utils_spec',
|
'pdfjs-test/unit/type1_parser_spec', 'pdfjs-test/unit/ui_utils_spec',
|
||||||
'pdfjs-test/unit/unicode_spec', 'pdfjs-test/unit/util_spec'
|
'pdfjs-test/unit/unicode_spec', 'pdfjs-test/unit/util_spec'
|
||||||
].map(function (moduleName) {
|
].map(function (moduleName) {
|
||||||
return SystemJS.import(moduleName);
|
return SystemJS.import(moduleName);
|
||||||
})).then(function (modules) {
|
})).then(function (modules) {
|
||||||
var displayGlobal = modules[0];
|
var displayGlobal = modules[0];
|
||||||
|
|
||||||
// Configure the worker.
|
// Configure the worker.
|
||||||
displayGlobal.PDFJS.workerSrc = '../../src/worker_loader.js';
|
displayGlobal.PDFJS.workerSrc = '../../src/worker_loader.js';
|
||||||
// Opt-in to using the latest API.
|
// Opt-in to using the latest API.
|
||||||
displayGlobal.PDFJS.pdfjsNext = true;
|
displayGlobal.PDFJS.pdfjsNext = true;
|
||||||
|
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
@ -12,20 +12,8 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import { Metadata } from '../../src/display/metadata';
|
||||||
if (typeof define === 'function' && define.amd) {
|
|
||||||
define('pdfjs-test/unit/metadata_spec', ['exports',
|
|
||||||
'pdfjs/display/metadata'], factory);
|
|
||||||
} else if (typeof exports !== 'undefined') {
|
|
||||||
factory(exports, require('../../src/display/metadata.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitMetadataSpec = {}), root.pdfjsDisplayMetadata);
|
|
||||||
}
|
|
||||||
}(this, function (exports, displayMetadata) {
|
|
||||||
|
|
||||||
var Metadata = displayMetadata.Metadata;
|
|
||||||
|
|
||||||
describe('metadata', function() {
|
describe('metadata', function() {
|
||||||
describe('incorrect_xmp', function() {
|
describe('incorrect_xmp', function() {
|
||||||
@ -40,4 +28,3 @@ describe('metadata', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,21 +12,8 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import { MurmurHash3_64 } from '../../src/core/murmurhash3';
|
||||||
if (typeof define === 'function' && define.amd) {
|
|
||||||
define('pdfjs-test/unit/murmurhash3_spec', ['exports',
|
|
||||||
'pdfjs/core/murmurhash3'], factory);
|
|
||||||
} else if (typeof exports !== 'undefined') {
|
|
||||||
factory(exports, require('../../src/core/murmurhash3.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitMurmurHash3Spec = {}),
|
|
||||||
root.pdfjsCoreMurmurHash3);
|
|
||||||
}
|
|
||||||
}(this, function (exports, coreMurmurHash3) {
|
|
||||||
|
|
||||||
var MurmurHash3_64 = coreMurmurHash3.MurmurHash3_64;
|
|
||||||
|
|
||||||
describe('MurmurHash3_64', function() {
|
describe('MurmurHash3_64', function() {
|
||||||
it('instantiates without seed', function() {
|
it('instantiates without seed', function() {
|
||||||
@ -76,4 +63,3 @@ describe('MurmurHash3_64', function() {
|
|||||||
expect(hexdigest1).not.toEqual(hexdigest2);
|
expect(hexdigest1).not.toEqual(hexdigest2);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,20 +12,8 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import { PDFNetworkStream } from '../../src/core/network';
|
||||||
if (typeof define === 'function' && define.amd) {
|
|
||||||
define('pdfjs-test/unit/network_spec', ['exports', 'pdfjs/core/network'],
|
|
||||||
factory);
|
|
||||||
} else if (typeof exports !== 'undefined') {
|
|
||||||
factory(exports, require('../../src/core/network.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitNetworkSpec = {}), root.pdfjsCoreNetwork);
|
|
||||||
}
|
|
||||||
}(this, function (exports, coreNetwork) {
|
|
||||||
|
|
||||||
var PDFNetworkStream = coreNetwork.PDFNetworkStream;
|
|
||||||
|
|
||||||
describe('network', function() {
|
describe('network', function() {
|
||||||
var pdf1 = new URL('../pdfs/tracemonkey.pdf', window.location).href;
|
var pdf1 = new URL('../pdfs/tracemonkey.pdf', window.location).href;
|
||||||
@ -189,4 +177,3 @@ describe('network', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,26 +12,10 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import { Lexer, Linearization } from '../../src/core/parser';
|
||||||
if (typeof define === 'function' && define.amd) {
|
import { Name } from '../../src/core/primitives';
|
||||||
define('pdfjs-test/unit/parser_spec', ['exports', 'pdfjs/core/parser',
|
import { StringStream } from '../../src/core/stream';
|
||||||
'pdfjs/core/primitives', 'pdfjs/core/stream'], factory);
|
|
||||||
} else if (typeof exports !== 'undefined') {
|
|
||||||
factory(exports, require('../../src/core/parser.js'),
|
|
||||||
require('../../src/core/primitives.js'),
|
|
||||||
require('../../src/core/stream.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitParserSpec = {}), root.pdfjsCoreParser,
|
|
||||||
root.pdfjsCorePrimitives, root.pdfjsCoreStream);
|
|
||||||
}
|
|
||||||
}(this, function (exports, coreParser, corePrimitives, coreStream) {
|
|
||||||
|
|
||||||
var Lexer = coreParser.Lexer;
|
|
||||||
var Linearization = coreParser.Linearization;
|
|
||||||
var Name = corePrimitives.Name;
|
|
||||||
var StringStream = coreStream.StringStream;
|
|
||||||
|
|
||||||
describe('parser', function() {
|
describe('parser', function() {
|
||||||
describe('Lexer', function() {
|
describe('Lexer', function() {
|
||||||
@ -294,4 +278,3 @@ describe('parser', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,29 +12,10 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import {
|
||||||
if (typeof define === 'function' && define.amd) {
|
Cmd, Dict, isCmd, isDict, isName, isRef, isRefsEqual, Name, Ref, RefSet
|
||||||
define('pdfjs-test/unit/primitives_spec', ['exports',
|
} from '../../src/core/primitives';
|
||||||
'pdfjs/core/primitives'], factory);
|
|
||||||
} else if (typeof exports !== 'undefined') {
|
|
||||||
factory(exports, require('../../src/core/primitives.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitPrimitivesSpec = {}), root.pdfjsCorePrimitives);
|
|
||||||
}
|
|
||||||
}(this, function (exports, corePrimitives) {
|
|
||||||
|
|
||||||
var Name = corePrimitives.Name;
|
|
||||||
var Dict = corePrimitives.Dict;
|
|
||||||
var Ref = corePrimitives.Ref;
|
|
||||||
var RefSet = corePrimitives.RefSet;
|
|
||||||
var Cmd = corePrimitives.Cmd;
|
|
||||||
var isName = corePrimitives.isName;
|
|
||||||
var isCmd = corePrimitives.isCmd;
|
|
||||||
var isDict = corePrimitives.isDict;
|
|
||||||
var isRef = corePrimitives.isRef;
|
|
||||||
var isRefsEqual = corePrimitives.isRefsEqual;
|
|
||||||
|
|
||||||
describe('primitives', function() {
|
describe('primitives', function() {
|
||||||
function XRefMock(array) {
|
function XRefMock(array) {
|
||||||
@ -404,4 +385,3 @@ describe('primitives', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,24 +12,9 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import { PredictorStream, Stream } from '../../src/core/stream';
|
||||||
if (typeof define === 'function' && define.amd) {
|
import { Dict } from '../../src/core/primitives';
|
||||||
define('pdfjs-test/unit/stream_spec', ['exports',
|
|
||||||
'pdfjs/core/primitives', 'pdfjs/core/stream'], factory);
|
|
||||||
} else if (typeof exports !== 'undefined') {
|
|
||||||
factory(exports, require('../../src/core/primitives.js'),
|
|
||||||
require('../../src/core/stream.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitStreamSpec = {}), root.pdfjsCorePrimitives,
|
|
||||||
root.pdfjsCoreStream);
|
|
||||||
}
|
|
||||||
}(this, function (exports, corePrimitives, coreStream) {
|
|
||||||
|
|
||||||
var Dict = corePrimitives.Dict;
|
|
||||||
var Stream = coreStream.Stream;
|
|
||||||
var PredictorStream = coreStream.PredictorStream;
|
|
||||||
|
|
||||||
describe('stream', function() {
|
describe('stream', function() {
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
@ -77,4 +62,3 @@ describe('stream', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,56 +12,41 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import { CMapCompressionType } from '../../src/shared/util';
|
||||||
if (typeof define === 'function' && define.amd) {
|
|
||||||
define('pdfjs-test/unit/test_utils', ['exports', 'pdfjs/shared/util'],
|
|
||||||
factory);
|
|
||||||
} else if (typeof exports !== 'undefined') {
|
|
||||||
factory(exports, require('../../src/shared/util.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitTestUtils = {}), root.pdfjsSharedUtil);
|
|
||||||
}
|
|
||||||
}(this, function (exports, sharedUtil) {
|
|
||||||
|
|
||||||
var CMapCompressionType = sharedUtil.CMapCompressionType;
|
class NodeCMapReaderFactory {
|
||||||
|
constructor(params) {
|
||||||
var NodeCMapReaderFactory = (function NodeCMapReaderFactoryClosure() {
|
|
||||||
function NodeCMapReaderFactory(params) {
|
|
||||||
this.baseUrl = params.baseUrl || null;
|
this.baseUrl = params.baseUrl || null;
|
||||||
this.isCompressed = params.isCompressed || false;
|
this.isCompressed = params.isCompressed || false;
|
||||||
}
|
}
|
||||||
|
|
||||||
NodeCMapReaderFactory.prototype = {
|
fetch(params) {
|
||||||
fetch: function(params) {
|
var name = params.name;
|
||||||
var name = params.name;
|
if (!name) {
|
||||||
if (!name) {
|
return Promise.reject(new Error('CMap name must be specified.'));
|
||||||
return Promise.reject(new Error('CMap name must be specified.'));
|
}
|
||||||
}
|
return new Promise((resolve, reject) => {
|
||||||
return new Promise(function (resolve, reject) {
|
var url = this.baseUrl + name + (this.isCompressed ? '.bcmap' : '');
|
||||||
var url = this.baseUrl + name + (this.isCompressed ? '.bcmap' : '');
|
|
||||||
|
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
fs.readFile(url, function (error, data) {
|
fs.readFile(url, (error, data) => {
|
||||||
if (error || !data) {
|
if (error || !data) {
|
||||||
reject(new Error('Unable to load ' +
|
reject(new Error('Unable to load ' +
|
||||||
(this.isCompressed ? 'binary ' : '') +
|
(this.isCompressed ? 'binary ' : '') +
|
||||||
'CMap at: ' + url));
|
'CMap at: ' + url));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
resolve({
|
resolve({
|
||||||
cMapData: new Uint8Array(data),
|
cMapData: new Uint8Array(data),
|
||||||
compressionType: this.isCompressed ?
|
compressionType: this.isCompressed ?
|
||||||
CMapCompressionType.BINARY : CMapCompressionType.NONE,
|
CMapCompressionType.BINARY : CMapCompressionType.NONE,
|
||||||
});
|
});
|
||||||
}.bind(this));
|
});
|
||||||
}.bind(this));
|
});
|
||||||
},
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
return NodeCMapReaderFactory;
|
export {
|
||||||
})();
|
NodeCMapReaderFactory,
|
||||||
|
};
|
||||||
exports.NodeCMapReaderFactory = NodeCMapReaderFactory;
|
|
||||||
}));
|
|
||||||
|
@ -12,26 +12,10 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import { SEAC_ANALYSIS_ENABLED } from '../../src/core/fonts';
|
||||||
if (typeof define === 'function' && define.amd) {
|
import { StringStream } from '../../src/core/stream';
|
||||||
define('pdfjs-test/unit/type1_parser_spec', ['exports',
|
import { Type1Parser } from '../../src/core/type1_parser';
|
||||||
'pdfjs/core/fonts', 'pdfjs/core/stream', 'pdfjs/core/type1_parser'],
|
|
||||||
factory);
|
|
||||||
} else if (typeof exports !== 'undefined') {
|
|
||||||
factory(exports, require('../../src/core/fonts.js'),
|
|
||||||
require('../../src/core/stream.js'),
|
|
||||||
require('../../src/core/type1_parser.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitType1ParserSpec = {}), root.pdfjsCoreFonts,
|
|
||||||
root.pdfjsCoreStream, root.pdfjsCoreType1Parser);
|
|
||||||
}
|
|
||||||
}(this, function (exports, coreFonts, coreStream, coreType1Parser) {
|
|
||||||
|
|
||||||
var SEAC_ANALYSIS_ENABLED = coreFonts.SEAC_ANALYSIS_ENABLED;
|
|
||||||
var StringStream = coreStream.StringStream;
|
|
||||||
var Type1Parser = coreType1Parser.Type1Parser;
|
|
||||||
|
|
||||||
describe('Type1Parser', function() {
|
describe('Type1Parser', function() {
|
||||||
it('splits tokens', function() {
|
it('splits tokens', function() {
|
||||||
@ -132,4 +116,3 @@ describe('Type1Parser', function() {
|
|||||||
expect(props.builtInEncoding[33]).toEqual('arrowright');
|
expect(props.builtInEncoding[33]).toEqual('arrowright');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,26 +12,11 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import {
|
||||||
if (typeof define === 'function' && define.amd) {
|
binarySearchFirstItem, EventBus, getPDFFileNameFromURL
|
||||||
define('pdfjs-test/unit/ui_utils_spec', ['exports',
|
} from '../../web/ui_utils';
|
||||||
'pdfjs-web/ui_utils', 'pdfjs/shared/util'], factory);
|
import { createObjectURL, isNodeJS } from '../../src/shared/util';
|
||||||
} else if (typeof exports !== 'undefined') {
|
|
||||||
factory(exports, require('../../web/ui_utils.js'),
|
|
||||||
require('../../src/shared/util.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitUiUtilsSpec = {}), root.pdfjsWebUiUtils,
|
|
||||||
root.pdfjsSharedUtil);
|
|
||||||
}
|
|
||||||
}(this, function (exports, webUiUtils, sharedUtil) {
|
|
||||||
|
|
||||||
var binarySearchFirstItem = webUiUtils.binarySearchFirstItem;
|
|
||||||
var getPDFFileNameFromURL = webUiUtils.getPDFFileNameFromURL;
|
|
||||||
var EventBus = webUiUtils.EventBus;
|
|
||||||
var createObjectURL = sharedUtil.createObjectURL;
|
|
||||||
var isNodeJS = sharedUtil.isNodeJS;
|
|
||||||
|
|
||||||
describe('ui_utils', function() {
|
describe('ui_utils', function() {
|
||||||
describe('binary search', function() {
|
describe('binary search', function() {
|
||||||
@ -275,4 +260,3 @@ describe('ui_utils', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,28 +12,14 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import {
|
||||||
if (typeof define === 'function' && define.amd) {
|
getDingbatsGlyphsUnicode, getGlyphsUnicode
|
||||||
define('pdfjs-test/unit/unicode_spec', ['exports',
|
} from '../../src/core/glyphlist';
|
||||||
'pdfjs/core/glyphlist', 'pdfjs/core/unicode'], factory);
|
import {
|
||||||
} else if (typeof exports !== 'undefined') {
|
getNormalizedUnicodes, getUnicodeForGlyph, getUnicodeRangeFor,
|
||||||
factory(exports, require('../../src/core/glyphlist.js'),
|
mapSpecialUnicodeValues, reverseIfRtl
|
||||||
require('../../src/core/unicode.js'));
|
} from '../../src/core/unicode';
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitUnicodeSpec = {}),
|
|
||||||
root.pdfjsCoreGlyphList, root.pdfjsCoreUnicode);
|
|
||||||
}
|
|
||||||
}(this, function (exports, coreGlyphList, coreUnicode) {
|
|
||||||
|
|
||||||
var getGlyphsUnicode = coreGlyphList.getGlyphsUnicode;
|
|
||||||
var getDingbatsGlyphsUnicode = coreGlyphList.getDingbatsGlyphsUnicode;
|
|
||||||
var mapSpecialUnicodeValues = coreUnicode.mapSpecialUnicodeValues;
|
|
||||||
var getUnicodeForGlyph = coreUnicode.getUnicodeForGlyph;
|
|
||||||
var getUnicodeRangeFor = coreUnicode.getUnicodeRangeFor;
|
|
||||||
var getNormalizedUnicodes = coreUnicode.getNormalizedUnicodes;
|
|
||||||
var reverseIfRtl = coreUnicode.reverseIfRtl;
|
|
||||||
|
|
||||||
describe('unicode', function () {
|
describe('unicode', function () {
|
||||||
describe('mapSpecialUnicodeValues', function () {
|
describe('mapSpecialUnicodeValues', function () {
|
||||||
@ -159,4 +145,3 @@ describe('unicode', function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
@ -12,21 +12,10 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
'use strict';
|
|
||||||
|
|
||||||
(function (root, factory) {
|
import {
|
||||||
if (typeof define === 'function' && define.amd) {
|
removeNullCharacters, stringToPDFString
|
||||||
define('pdfjs-test/unit/util_spec', ['exports',
|
} from '../../src/shared/util';
|
||||||
'pdfjs/shared/util'], factory);
|
|
||||||
} else if (typeof exports !== 'undefined') {
|
|
||||||
factory(exports, require('../../src/shared/util.js'));
|
|
||||||
} else {
|
|
||||||
factory((root.pdfjsTestUnitUtilSpec = {}), root.pdfjsSharedUtil);
|
|
||||||
}
|
|
||||||
}(this, function (exports, sharedUtil) {
|
|
||||||
|
|
||||||
var stringToPDFString = sharedUtil.stringToPDFString;
|
|
||||||
var removeNullCharacters = sharedUtil.removeNullCharacters;
|
|
||||||
|
|
||||||
describe('util', function() {
|
describe('util', function() {
|
||||||
describe('stringToPDFString', function() {
|
describe('stringToPDFString', function() {
|
||||||
@ -63,4 +52,3 @@ describe('util', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user