OLD | NEW |
1 if (this.importScripts) { | 1 if (this.importScripts) { |
2 importScripts('../../../resources/js-test.js'); | 2 importScripts('../../../resources/js-test.js'); |
3 importScripts('shared.js'); | 3 importScripts('shared.js'); |
4 } | 4 } |
5 | 5 |
6 description("Test IndexedDB keyPath with intrinsic properties"); | 6 description("Test IndexedDB keyPath with intrinsic properties"); |
7 | 7 |
8 indexedDBTest(prepareDatabase, testKeyPaths); | 8 indexedDBTest(prepareDatabase, testKeyPaths); |
9 function prepareDatabase() | 9 function prepareDatabase() |
10 { | 10 { |
(...skipping 14 matching lines...) Expand all Loading... |
25 transaction.onabort = unexpectedAbortCallback; | 25 transaction.onabort = unexpectedAbortCallback; |
26 store = evalAndLog("store = transaction.objectStore('store')"); | 26 store = evalAndLog("store = transaction.objectStore('store')"); |
27 | 27 |
28 for (var i = 0; i < 5; i += 1) { | 28 for (var i = 0; i < 5; i += 1) { |
29 var datum = { | 29 var datum = { |
30 id: 'id#' + i, | 30 id: 'id#' + i, |
31 string: Array(i * 2 + 1).join('x'), | 31 string: Array(i * 2 + 1).join('x'), |
32 array: Array(i * 3 + 1).join('x').split(/(?:)/), | 32 array: Array(i * 3 + 1).join('x').split(/(?:)/), |
33 blob: new Blob([Array(i * 4 + 1).join('x')], {type: "type " + i}) | 33 blob: new Blob([Array(i * 4 + 1).join('x')], {type: "type " + i}) |
34 }; | 34 }; |
35 debug("store.put(" + JSON.stringify(datum) + ")"); | 35 debug("store.put(" + stringifyDOMObject(datum) + ")"); |
36 store.put(datum); | 36 store.put(datum); |
37 } | 37 } |
38 | 38 |
39 checkStringLengths(); | 39 checkStringLengths(); |
40 | 40 |
41 function checkStringLengths() { | 41 function checkStringLengths() { |
42 evalAndLog("request = store.index('string length').openCursor()"); | 42 evalAndLog("request = store.index('string length').openCursor()"); |
43 request.onerror = unexpectedErrorCallback; | 43 request.onerror = unexpectedErrorCallback; |
44 request.onsuccess = function (e) { | 44 request.onsuccess = function (e) { |
45 cursor = e.target.result; | 45 cursor = e.target.result; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 cursor = e.target.result; | 87 cursor = e.target.result; |
88 if (cursor) { | 88 if (cursor) { |
89 shouldBe("cursor.key", "cursor.value.blob.type"); | 89 shouldBe("cursor.key", "cursor.value.blob.type"); |
90 cursor.continue(); | 90 cursor.continue(); |
91 } | 91 } |
92 } | 92 } |
93 } | 93 } |
94 | 94 |
95 transaction.oncomplete = finishJSTest; | 95 transaction.oncomplete = finishJSTest; |
96 } | 96 } |
OLD | NEW |