mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 23:28:06 +02:00
Reduce the overall indentation level in Catalog_readDocumentOutline
, by using early returns, in order to improve readability
This commit is contained in:
parent
e9a1a47d28
commit
98db068079
2 changed files with 70 additions and 56 deletions
|
@ -430,6 +430,19 @@ describe('api', function() {
|
|||
loadingTask.destroy();
|
||||
});
|
||||
});
|
||||
it('gets non-existent outline', function() {
|
||||
var url = combineUrl(window.location.href, '../pdfs/tracemonkey.pdf');
|
||||
var loadingTask = PDFJS.getDocument(url);
|
||||
|
||||
var promise = loadingTask.promise.then(function (pdfDocument) {
|
||||
return pdfDocument.getOutline();
|
||||
});
|
||||
waitsForPromiseResolved(promise, function (outline) {
|
||||
expect(outline).toEqual(null);
|
||||
|
||||
loadingTask.destroy();
|
||||
});
|
||||
});
|
||||
it('gets outline', function() {
|
||||
var promise = doc.getOutline();
|
||||
waitsForPromiseResolved(promise, function(outline) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue