Update preview image generation. Update unit tests.
[bookreader.git] / BookReaderIA / test / unit / Common.js
1 // Defines common variables for testing
2 // TODO - don't use global namespace
3
4 // $$$ TODO make test host auto-magic
5 common = {
6     testHost: 'http://www-testflip.archive.org'
7     // testHost: 'http://www-mang.archive.org'    
8 }
9
10 // Set up dummy BookReader class for JSLocate
11 function BookReader() {
12 };
13
14 BookReader.prototype.init = function() {
15     return true;
16 };
17
18
19 // Returns locator URL for the given id
20 function jsLocateURL(identifier, book) {
21     var bookURL = common.testHost + '/bookreader/BookReaderJSLocate.php?id=' + identifier;
22     if (book) {
23         bookURL += '&book=' + book;
24     }
25     return bookURL;
26 }
27
28 function previewURL(identifier, bookId, page) {
29     return common.testHost + '/download/' + identifier + '/page/' + bookId + '_' + page + '.jpg';
30 }