Browse Source

Add unit test for |MissingPDFException|

Jonas Jenwald 11 years ago
parent
commit
27a80f3b88
  1. 10
      test/unit/api_spec.js

10
test/unit/api_spec.js

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* globals PDFJS, expect, it, describe, Promise, combineUrl, waitsFor,
isArray */
isArray, MissingPDFException */
'use strict';
@ -79,6 +79,14 @@ describe('api', function() { @@ -79,6 +79,14 @@ describe('api', function() {
expect(true).toEqual(true);
});
});
it('creates pdf doc from non-existent URL', function() {
var nonExistentUrl = combineUrl(window.location.href,
'../pdfs/non-existent.pdf');
var promise = PDFJS.getDocument(nonExistentUrl);
waitsForPromiseRejected(promise, function(error) {
expect(error instanceof MissingPDFException).toEqual(true);
});
});
});
});
describe('PDFDocument', function() {

Loading…
Cancel
Save