1 // Tests for BookReaderJSLocate.php
3 // $$$ TODO -- make the test host configurable/automagic
7 testHost = 'http://www-testflip.archive.org';
9 // Returns locator URL for the given id
10 function jsLocateURL(bookId) {
11 return testHost + '/bookreader/BookReaderJSLocate.php?id=' + bookId;
14 // Set up dummy BookReader class for JSLocate
15 function BookReader() {
18 BookReader.prototype.init = function() {
22 asyncTest("JSLocate for notesonsubmarine00grea", function() {
24 $.getScript( jsLocateURL('notesonsubmarine00grea'),
25 function(data, textStatus) {
26 equals(window.br.titleLeaf, 5, 'Metadata loaded. See https://bugs.launchpad.net/bookreader/+bug/517424. Title leaf');
32 asyncTest("JSLocate for photographingclo00carprich", function() {
34 $.getScript( jsLocateURL('photographingclo00carprich'),
35 function(data, textStatus) {
36 equals(window.br.bookTitle, 'Photographing clouds from an airplane', 'Title of book');
42 asyncTest("JSLocate for salmoncookbookho00panaiala", function() {
44 $.getScript( jsLocateURL('salmoncookbookho00panaiala'),
45 function(data, textStatus) {
46 equals(window.br.numLeafs, 40, 'Number of pages');