| OLD | NEW |
| 1 // original test: | 1 // original test: |
| 2 // http://mxr.mozilla.org/mozilla2.0/source/dom/indexedDB/test/test_indexes.html
?force=1 | 2 // http://mxr.mozilla.org/mozilla2.0/source/dom/indexedDB/test/test_indexes.html
?force=1 |
| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 function setVersionComplete() | 87 function setVersionComplete() |
| 88 { | 88 { |
| 89 objectStore = evalAndLog("objectStore = db.transaction(objectStoreName).obje
ctStore(objectStoreName);"); | 89 objectStore = evalAndLog("objectStore = db.transaction(objectStoreName).obje
ctStore(objectStoreName);"); |
| 90 | 90 |
| 91 // Check global properties to make sure they are correct. | 91 // Check global properties to make sure they are correct. |
| 92 shouldBe("objectStore.indexNames.length", "indexData.length"); | 92 shouldBe("objectStore.indexNames.length", "indexData.length"); |
| 93 for (i in indexData) { | 93 for (i in indexData) { |
| 94 found = false; | 94 found = false; |
| 95 for (j = 0; j < objectStore.indexNames.length; j++) { | 95 for (j = 0; j < objectStore.indexNames.length; j++) { |
| 96 if (objectStore.indexNames.item(j) == indexData[i].name) { | 96 if (objectStore.indexNames[j] == indexData[i].name) { |
| 97 found = true; | 97 found = true; |
| 98 break; | 98 break; |
| 99 } | 99 } |
| 100 } | 100 } |
| 101 shouldBeTrue("found"); | 101 shouldBeTrue("found"); |
| 102 index = evalAndLog("index = objectStore.index(indexData[i].name);"); | 102 index = evalAndLog("index = objectStore.index(indexData[i].name);"); |
| 103 shouldBe("index.name", "indexData[i].name"); | 103 shouldBe("index.name", "indexData[i].name"); |
| 104 shouldBe("index.keyPath", "indexData[i].keyPath"); | 104 shouldBe("index.keyPath", "indexData[i].keyPath"); |
| 105 shouldBe("index.unique", indexData[i].options.unique ? "true" : "false")
; | 105 shouldBe("index.unique", indexData[i].options.unique ? "true" : "false")
; |
| 106 } | 106 } |
| (...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 } | 972 } |
| 973 | 973 |
| 974 keyIndex += keyIndex ? 1 : 2; | 974 keyIndex += keyIndex ? 1 : 2; |
| 975 } | 975 } |
| 976 else { | 976 else { |
| 977 shouldBe("keyIndex", "objectStoreDataNameSort.length"); | 977 shouldBe("keyIndex", "objectStoreDataNameSort.length"); |
| 978 finishJSTest(); | 978 finishJSTest(); |
| 979 } | 979 } |
| 980 } | 980 } |
| 981 } | 981 } |
| OLD | NEW |