OLD | NEW |
1 Test IndexedDB's opening DB more than once | 1 Test IndexedDB's opening DB more than once |
2 | 2 |
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". | 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
". |
4 | 4 |
5 | 5 |
6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.
msIndexedDB || self.OIndexedDB; | 6 indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.
msIndexedDB || self.OIndexedDB; |
7 | 7 |
8 dbname = "global-data.html" | 8 dbname = "global-data.html" |
9 indexedDB.deleteDatabase(dbname) | 9 indexedDB.deleteDatabase(dbname) |
10 indexedDB.open(dbname) | 10 indexedDB.open(dbname) |
11 db1.createObjectStore(objectStoreName, objectStoreOptions); | 11 db1.createObjectStore(objectStoreName, objectStoreOptions); |
12 indexedDB.open(dbname); | 12 indexedDB.open(dbname); |
13 db2 = event.target.result | 13 db2 = event.target.result |
14 PASS db1 !== db2 is true | 14 PASS db1 !== db2 is true |
15 PASS db1.objectStoreNames.length is 1 | 15 PASS db1.objectStoreNames.length is 1 |
16 PASS db1.objectStoreNames.item(0) is objectStoreName | 16 PASS db1.objectStoreNames[0] is objectStoreName |
17 PASS db2.objectStoreNames.length is 1 | 17 PASS db2.objectStoreNames.length is 1 |
18 PASS db2.objectStoreNames.item(0) is objectStoreName | 18 PASS db2.objectStoreNames[0] is objectStoreName |
19 objectStore1 = db1.transaction(objectStoreName).objectStore(objectStoreName); | 19 objectStore1 = db1.transaction(objectStoreName).objectStore(objectStoreName); |
20 PASS objectStore1.name is objectStoreName | 20 PASS objectStore1.name is objectStoreName |
21 PASS objectStore1.keyPath is objectStoreOptions.keyPath | 21 PASS objectStore1.keyPath is objectStoreOptions.keyPath |
22 objectStore2 = db2.transaction(objectStoreName).objectStore(objectStoreName); | 22 objectStore2 = db2.transaction(objectStoreName).objectStore(objectStoreName); |
23 PASS objectStore1 !== objectStore2 is true | 23 PASS objectStore1 !== objectStore2 is true |
24 PASS objectStore2.name is objectStoreName | 24 PASS objectStore2.name is objectStoreName |
25 PASS objectStore2.keyPath is objectStoreOptions.keyPath | 25 PASS objectStore2.keyPath is objectStoreOptions.keyPath |
26 PASS successfullyParsed is true | 26 PASS successfullyParsed is true |
27 | 27 |
28 TEST COMPLETE | 28 TEST COMPLETE |
29 | 29 |
OLD | NEW |