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

Refactors CMapFactory.create to make it async

This commit is contained in:
Manas 2016-02-28 21:50:29 +05:30
parent c6d2b7f9d9
commit f6d28ca323
8 changed files with 559 additions and 473 deletions

View file

@ -6,17 +6,20 @@ describe('font_fpgm', function() {
it('table was truncated in the middle of functions', function() {
var output;
waitsFor(function() { return output; }, 10000);
var font = new Font("font", new Stream(font2324), {
loadedName: 'font',
type: 'CIDFontType2',
differences: [],
defaultEncoding: [],
cMap: CMapFactory.create(new Name('Identity-H'))
});
ttx(font.data, function(result) { output = result; });
runs(function() {
verifyTtxOutput(output);
expect(/(ENDF\[ \]|SVTCA\[0\])\s*<\/assembly>\s*<\/fpgm>/.test(output)).toEqual(true);
CMapFactory.create(new Name('Identity-H')).then(function (cMap) {
var font = new Font("font", new Stream(font2324), {
loadedName: 'font',
type: 'CIDFontType2',
differences: [],
defaultEncoding: [],
cMap: cMap,
toUnicode: new ToUnicodeMap([])
});
ttx(font.data, function(result) { output = result; });
runs(function() {
verifyTtxOutput(output);
expect(/(ENDF\[ \]|SVTCA\[0\])\s*<\/assembly>\s*<\/fpgm>/.test(output)).toEqual(true);
});
});
});
});