1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Merge remote-tracking branch 'upstream/master' into test

This commit is contained in:
Kalervo Kujala 2011-11-20 20:03:11 +02:00
commit 94a64eece9
10 changed files with 817 additions and 547 deletions

View file

@ -56,23 +56,29 @@ function load() {
}
function cleanup() {
var styleSheet = document.styleSheets[0];
if (styleSheet) {
// Clear out all the stylesheets since a new one is created for each font.
while (document.styleSheets.length > 0) {
var styleSheet = document.styleSheets[0];
while (styleSheet.cssRules.length > 0)
styleSheet.deleteRule(0);
var ownerNode = styleSheet.ownerNode;
ownerNode.parentNode.removeChild(ownerNode);
}
var guard = document.getElementById('content-end');
var body = document.body;
while (body.lastChild !== guard)
body.removeChild(body.lastChild);
// Wipe out the link to the pdfdoc so it can be GC'ed.
for (var i = 0; i < manifest.length; i++) {
if (manifest[i].pdfDoc) {
manifest[i].pdfDoc.destroy();
delete manifest[i].pdfDoc;
}
}
}
function nextTask() {
// If there is a pdfDoc on the last task executed, destroy it to free memory.
if (task && task.pdfDoc) {
task.pdfDoc.destroy();
delete task.pdfDoc;
}
cleanup();
if (currentTaskIdx == manifest.length) {

View file

@ -323,18 +323,18 @@ def verifyPDFs(manifestList):
if os.access(f, os.R_OK):
fileMd5 = hashlib.md5(open(f, 'rb').read()).hexdigest()
if 'md5' not in item:
print 'ERROR: Missing md5 for file "' + f + '".',
print 'WARNING: Missing md5 for file "' + f + '".',
print 'Hash for current file is "' + fileMd5 + '"'
error = True
continue
md5 = item['md5']
if fileMd5 != md5:
print 'ERROR: MD5 of file "' + f + '" does not match file.',
print 'WARNING: MD5 of file "' + f + '" does not match file.',
print 'Expected "' + md5 + '" computed "' + fileMd5 + '"'
error = True
continue
else:
print 'ERROR: Unable to open file for reading "' + f + '".'
print 'WARNING: Unable to open file for reading "' + f + '".'
error = True
return not error
@ -365,7 +365,8 @@ def setUp(options):
downloadLinkedPDFs(manifestList)
if not verifyPDFs(manifestList):
raise Exception('ERROR: failed to verify pdfs.')
print 'Unable to verify the checksum for the files that are used for testing.'
print 'Please re-download the files, or adjust the MD5 checksum in the manifest for the files listed above.\n'
for b in testBrowsers:
State.taskResults[b.name] = { }

View file

@ -19,7 +19,7 @@
},
{ "id": "intelisa-load",
"file": "pdfs/intelisa.pdf",
"md5": "f3ed5487d1afa34d8b77c0c734a95c79",
"md5": "f5712097d29287a97f1278839814f682",
"link": true,
"rounds": 1,
"type": "load"
@ -194,7 +194,7 @@
},
{ "id": "f1040",
"file": "pdfs/f1040.pdf",
"md5": "7323b50c6d28d959b8b4b92c469b2469",
"md5": "b59272ce19b4a0c5808c8861441b0741",
"link": true,
"rounds": 1,
"type": "load"