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 the basics of IndexedDB's IDBObjectStore."); | 6 description("Test the basics of IndexedDB's IDBObjectStore."); |
7 | 7 |
8 indexedDBTest(prepareDatabase, testSetVersionAbort); | 8 indexedDBTest(prepareDatabase, testSetVersionAbort); |
9 function prepareDatabase(evt) | 9 function prepareDatabase(evt) |
10 { | 10 { |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 shouldBeEqualToString("store.indexNames[0]", "indexName"); | 113 shouldBeEqualToString("store.indexNames[0]", "indexName"); |
114 shouldBeUndefined("store.indexNames[1]"); | 114 shouldBeUndefined("store.indexNames[1]"); |
115 shouldBeUndefined("store.indexNames[100]"); | 115 shouldBeUndefined("store.indexNames[100]"); |
116 shouldBeNull("store.indexNames.item(1)"); | 116 shouldBeNull("store.indexNames.item(1)"); |
117 shouldBeNull("store.indexNames.item(100)"); | 117 shouldBeNull("store.indexNames.item(100)"); |
118 } | 118 } |
119 | 119 |
120 var testDate = new Date("August 25, 1991 20:57:08"); | 120 var testDate = new Date("August 25, 1991 20:57:08"); |
121 var testDateB = new Date("Wed Jan 05 2011 15:54:49"); | 121 var testDateB = new Date("Wed Jan 05 2011 15:54:49"); |
122 | 122 |
123 function openAgain() | 123 function openAgain(evt) |
124 { | 124 { |
125 preamble(); | 125 preamble(evt); |
| 126 evt.preventDefault(); |
| 127 |
126 request = evalAndLog('indexedDB.open(dbname)'); | 128 request = evalAndLog('indexedDB.open(dbname)'); |
127 request.onerror = unexpectedErrorCallback; | 129 request.onerror = unexpectedErrorCallback; |
128 request.onblocked = unexpectedBlockedCallback; | 130 request.onblocked = unexpectedBlockedCallback; |
129 request.onupgradeneeded = unexpectedUpgradeNeededCallback; | 131 request.onupgradeneeded = unexpectedUpgradeNeededCallback; |
130 request.onsuccess = addData; | 132 request.onsuccess = addData; |
131 } | 133 } |
132 | 134 |
133 function addData(evt) | 135 function addData(evt) |
134 { | 136 { |
135 preamble(evt); | 137 preamble(evt); |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 | 302 |
301 debug("The object store uses in-line keys but no key generator and the r
esult of evaluating the object store's key path does not yield a value."); | 303 debug("The object store uses in-line keys but no key generator and the r
esult of evaluating the object store's key path does not yield a value."); |
302 evalAndExpectException("storeWithInLineKeys.add({})", "0", "'DataError'"
); | 304 evalAndExpectException("storeWithInLineKeys.add({})", "0", "'DataError'"
); |
303 | 305 |
304 debug("The key parameter was provided but does not contain a valid key."
); | 306 debug("The key parameter was provided but does not contain a valid key."
); |
305 evalAndExpectException("storeWithOutOfLineKeys.add({}, null)", "0", "'Da
taError'"); | 307 evalAndExpectException("storeWithOutOfLineKeys.add({}, null)", "0", "'Da
taError'"); |
306 | 308 |
307 finishJSTest(); | 309 finishJSTest(); |
308 }; | 310 }; |
309 } | 311 } |
OLD | NEW |