OLD | NEW |
1 // original test: | 1 // original test: |
2 // http://mxr.mozilla.org/mozilla2.0/source/dom/indexedDB/test/test_create_index
.html | 2 // http://mxr.mozilla.org/mozilla2.0/source/dom/indexedDB/test/test_create_index
.html |
3 // license of original test: | 3 // license of original test: |
4 // " Any copyright is dedicated to the Public Domain. | 4 // " Any copyright is dedicated to the Public Domain. |
5 // http://creativecommons.org/publicdomain/zero/1.0/ " | 5 // http://creativecommons.org/publicdomain/zero/1.0/ " |
6 | 6 |
7 if (this.importScripts) { | 7 if (this.importScripts) { |
8 importScripts('../../../../resources/js-test.js'); | 8 importScripts('../../../../resources/js-test.js'); |
9 importScripts('../../resources/shared.js'); | 9 importScripts('../../resources/shared.js'); |
10 } | 10 } |
(...skipping 10 matching lines...) Expand all Loading... |
21 indexName = "1"; | 21 indexName = "1"; |
22 indexKeyPath = "unique_value"; | 22 indexKeyPath = "unique_value"; |
23 index = evalAndLog("index = objectStore.createIndex(indexName, indexKeyPath,
{ unique: true });"); | 23 index = evalAndLog("index = objectStore.createIndex(indexName, indexKeyPath,
{ unique: true });"); |
24 shouldBe("index.name", "indexName"); | 24 shouldBe("index.name", "indexName"); |
25 shouldBe("index.keyPath", "indexKeyPath"); | 25 shouldBe("index.keyPath", "indexKeyPath"); |
26 shouldBe("index.unique", "true"); | 26 shouldBe("index.unique", "true"); |
27 shouldBe("objectStore.indexNames.length", "1"); | 27 shouldBe("objectStore.indexNames.length", "1"); |
28 | 28 |
29 foundNewlyCreatedIndex = false; | 29 foundNewlyCreatedIndex = false; |
30 for (var k = 0; k < objectStore.indexNames.length; k++) { | 30 for (var k = 0; k < objectStore.indexNames.length; k++) { |
31 if (objectStore.indexNames.item(k) == indexName) { | 31 if (objectStore.indexNames[k] == indexName) { |
32 foundNewlyCreatedIndex = true; | 32 foundNewlyCreatedIndex = true; |
33 } | 33 } |
34 } | 34 } |
35 shouldBeTrue("foundNewlyCreatedIndex"); | 35 shouldBeTrue("foundNewlyCreatedIndex"); |
36 shouldBe("event.target.transaction.db", "db"); | 36 shouldBe("event.target.transaction.db", "db"); |
37 shouldBe("event.target.transaction.mode", "'versionchange'"); | 37 shouldBe("event.target.transaction.mode", "'versionchange'"); |
38 finishJSTest(); | 38 finishJSTest(); |
39 } | 39 } |
OLD | NEW |