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:
commit
103f4616ac
10 changed files with 99 additions and 10 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue