OLD | NEW |
---|---|
1 if (this.importScripts) { | 1 if (this.importScripts) { |
2 importScripts('../../../fast/js/resources/js-test-pre.js'); | 2 importScripts('../../../fast/js/resources/js-test-pre.js'); |
3 importScripts('shared.js'); | 3 importScripts('shared.js'); |
4 } | 4 } |
5 | 5 |
6 description("Test that data inserted into IndexedDB does not get corrupted on di sk."); | 6 description("Test that data inserted into IndexedDB does not get corrupted on di sk."); |
7 | 7 |
8 indexedDBTest(prepareDatabase, addData); | 8 indexedDBTest(prepareDatabase, addData); |
9 function prepareDatabase() | 9 function prepareDatabase() |
10 { | 10 { |
11 db = event.target.result; | 11 db = event.target.result; |
12 debug("setVersionSuccess():"); | 12 debug("setVersionSuccess():"); |
13 shouldBeEqualToString("event.dataLoss", "none"); | |
jsbell
2013/06/17 23:37:35
You should also add a "'dataLoss' in XXXXX" case t
dgrogan
2013/06/17 23:52:14
Done.
| |
13 self.trans = evalAndLog("trans = event.target.transaction"); | 14 self.trans = evalAndLog("trans = event.target.transaction"); |
14 shouldBeNonNull("trans"); | 15 shouldBeNonNull("trans"); |
15 trans.onabort = unexpectedAbortCallback; | 16 trans.onabort = unexpectedAbortCallback; |
16 | 17 |
17 evalAndLog("db.createObjectStore('storeName')"); | 18 evalAndLog("db.createObjectStore('storeName')"); |
18 } | 19 } |
19 | 20 |
20 var testDate = new Date('February 24, 1955 12:00:08'); | 21 var testDate = new Date('February 24, 1955 12:00:08'); |
21 | 22 |
22 function addData() | 23 function addData() |
(...skipping 12 matching lines...) Expand all Loading... | |
35 var request = evalAndLog("request = transaction.objectStore('storeName').get ('key')"); | 36 var request = evalAndLog("request = transaction.objectStore('storeName').get ('key')"); |
36 request.onerror = unexpectedErrorCallback; | 37 request.onerror = unexpectedErrorCallback; |
37 request.onsuccess = doCheck; | 38 request.onsuccess = doCheck; |
38 } | 39 } |
39 | 40 |
40 function doCheck() | 41 function doCheck() |
41 { | 42 { |
42 shouldBe("event.target.result.x.toString()", "testDate.toString()"); | 43 shouldBe("event.target.result.x.toString()", "testDate.toString()"); |
43 finishJSTest(); | 44 finishJSTest(); |
44 } | 45 } |
OLD | NEW |