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 webkitIDBIndex."); | 6 description("Test the basics of IndexedDB's IDBIndex."); |
7 | 7 |
8 indexedDBTest(prepareDatabase); | 8 indexedDBTest(prepareDatabase); |
9 function prepareDatabase(evt) | 9 function prepareDatabase(evt) |
10 { | 10 { |
11 preamble(evt); | 11 preamble(evt); |
12 db = event.target.result; | 12 db = event.target.result; |
13 event.target.transaction.onabort = unexpectedAbortCallback; | 13 event.target.transaction.onabort = unexpectedAbortCallback; |
14 self.store = evalAndLog("db.createObjectStore('storeName', null)"); | 14 self.store = evalAndLog("db.createObjectStore('storeName', null)"); |
15 self.indexObject = evalAndLog("store.createIndex('indexName', 'x')"); | 15 self.indexObject = evalAndLog("store.createIndex('indexName', 'x')"); |
16 self.indexObject2 = evalAndLog("store.createIndex('indexName2', 'y', {unique
: false})"); | 16 self.indexObject2 = evalAndLog("store.createIndex('indexName2', 'y', {unique
: false})"); |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 shouldBe("event.target.result", "2"); | 316 shouldBe("event.target.result", "2"); |
317 | 317 |
318 debug("Passing an invalid key into indexObject.get({})."); | 318 debug("Passing an invalid key into indexObject.get({})."); |
319 evalAndExpectException("indexObject.get({})", "0", "'DataError'"); | 319 evalAndExpectException("indexObject.get({})", "0", "'DataError'"); |
320 | 320 |
321 debug("Passing an invalid key into indexObject.getKey({})."); | 321 debug("Passing an invalid key into indexObject.getKey({})."); |
322 evalAndExpectException("indexObject.getKey({})", "0", "'DataError'"); | 322 evalAndExpectException("indexObject.getKey({})", "0", "'DataError'"); |
323 | 323 |
324 finishJSTest(); | 324 finishJSTest(); |
325 } | 325 } |
OLD | NEW |