From 27388351e0b3e9589f38f14689d63e7a75a8f5e9 Mon Sep 17 00:00:00 2001 From: Michael Ang Date: Tue, 23 Feb 2010 00:16:52 +0000 Subject: [PATCH] Add test for jpeg from tar file --- BookReaderIA/test/unit/Images.js | 35 ++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/BookReaderIA/test/unit/Images.js b/BookReaderIA/test/unit/Images.js index ce5d489..7c934e6 100644 --- a/BookReaderIA/test/unit/Images.js +++ b/BookReaderIA/test/unit/Images.js @@ -20,7 +20,9 @@ BookReader.prototype.init = function() { return true; }; -asyncTest("JSLocate for windwavesatseabr00bige", function() { + +/// windwavesatseabr00bige - jp2 zip +asyncTest("JSLocate for windwavesatseabr00bige - Scribe jp2.zip book", function() { expect(1); $.getScript( jsLocateURL('windwavesatseabr00bige'), function(data, textStatus) { equals(br.numLeafs, 224, 'JSLocate successful. numLeafs'); @@ -49,7 +51,9 @@ asyncTest("Load windwavesatseabr00bige image 5", function() { .attr('src', pageURI); }); -asyncTest("JSLocate for asamoandictiona00pragoog - tiff book", function() { + +/// asamoandictiona00pragoog - tiff zip +asyncTest("JSLocate for asamoandictiona00pragoog - tiff.zip book", function() { expect(1); $.getScript( jsLocateURL('asamoandictiona00pragoog'), function() { equals(br.bookTitle, @@ -59,7 +63,7 @@ asyncTest("JSLocate for asamoandictiona00pragoog - tiff book", function() { }); }); -asyncTest("Load tiff image", function() { +asyncTest("Load tiff image from zip", function() { expect(2); var pageURI = br.getPageURI(23, 8); var img = new Image(); @@ -69,4 +73,27 @@ asyncTest("Load tiff image", function() { start(); }) .attr('src', pageURI); -}); \ No newline at end of file +}); + + +/// hccapp56191900uoft - jpeg tar +asyncTest("JSLocate for hccapp56191900uoft - jpg.tar", function() { + expect(1); + $.getScript( jsLocateURL('hccapp56191900uoft'), function() { + equals(br.numLeafs, 1101, 'Number of pages'); + start(); + }); +}); + +asyncTest('Load jpg image from tar file', function() { + expect(2); + var pageURI = br.getPageURI(6, 8); + var img = new Image(); + $(img).bind( 'load error', function(eventObj) { + equals(eventObj.type, 'load', 'Load image (' + pageURI + '). Event handler called'); + equals(this.width, 244, 'Image width'); + start(); + }) + .attr('src', pageURI); +}); + -- 2.20.1