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

Merge pull request #10334 from Snuffleupagus/OpenAction-dest

[api-minor] Add support for OpenAction destinations (issue 10332)
This commit is contained in:
Tim van der Meij 2018-12-23 20:49:50 +01:00 committed by GitHub
commit 103f4616ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 99 additions and 10 deletions

View file

@ -650,6 +650,24 @@ describe('api', function() {
}).catch(done.fail);
});
it('gets default open action destination', function(done) {
var loadingTask = getDocument(buildGetDocumentParams('tracemonkey.pdf'));
loadingTask.promise.then(function(pdfDocument) {
return pdfDocument.getOpenActionDestination();
}).then(function(dest) {
expect(dest).toEqual(null);
loadingTask.destroy().then(done);
}).catch(done.fail);
});
it('gets non-default open action destination', function(done) {
doc.getOpenActionDestination().then(function(dest) {
expect(dest).toEqual([{ num: 15, gen: 0, }, { name: 'FitH', }, null]);
done();
}).catch(done.fail);
});
it('gets non-existent attachments', function(done) {
var promise = doc.getAttachments();
promise.then(function (data) {