[Pkg-javascript-commits] [pdf.js] 51/204: Add unit test for |MissingPDFException|

David Prévot taffit at moszumanska.debian.org
Sat Oct 25 18:50:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 27a80f3b888e9c04f2d28976ae7353c6dcaa99a5
Author: Jonas Jenwald <jonas.jenwald at gmail.com>
Date:   Sun Sep 7 17:39:49 2014 +0200

    Add unit test for |MissingPDFException|
---
 test/unit/api_spec.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/test/unit/api_spec.js b/test/unit/api_spec.js
index e3af963..c6bf660 100644
--- a/test/unit/api_spec.js
+++ b/test/unit/api_spec.js
@@ -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() {
           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() {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list