OLD | NEW |
1 Test IndexedDB: object identity | 1 Test IndexedDB: object identity |
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; | |
7 | |
8 dbname = "object-identity.html" | 6 dbname = "object-identity.html" |
9 indexedDB.deleteDatabase(dbname) | 7 indexedDB.deleteDatabase(dbname) |
10 indexedDB.open(dbname) | 8 indexedDB.open(dbname) |
11 transaction = event.target.transaction; | 9 transaction = event.target.transaction; |
12 objectStore1 = db.createObjectStore('foo'); | 10 objectStore1 = db.createObjectStore('foo'); |
13 objectStore2 = transaction.objectStore('foo'); | 11 objectStore2 = transaction.objectStore('foo'); |
14 PASS objectStore1 === objectStore2 is true | 12 PASS objectStore1 === objectStore2 is true |
15 index1 = objectStore1.createIndex('bar', 'key'); | 13 index1 = objectStore1.createIndex('bar', 'key'); |
16 index2 = objectStore2.index('bar'); | 14 index2 = objectStore2.index('bar'); |
17 PASS index1 === index2 is true | 15 PASS index1 === index2 is true |
18 transaction = db.transaction('foo'); | 16 transaction = db.transaction('foo'); |
19 objectStore3 = transaction.objectStore('foo'); | 17 objectStore3 = transaction.objectStore('foo'); |
20 objectStore3.someProperty = 'xyz' | 18 objectStore3.someProperty = 'xyz' |
21 objectStore4 = transaction.objectStore('foo'); | 19 objectStore4 = transaction.objectStore('foo'); |
22 PASS objectStore3 === objectStore4 is true | 20 PASS objectStore3 === objectStore4 is true |
23 PASS objectStore4.someProperty is "xyz" | 21 PASS objectStore4.someProperty is "xyz" |
24 PASS objectStore3 === objectStore1 is false | 22 PASS objectStore3 === objectStore1 is false |
25 PASS objectStore4 === objectStore2 is false | 23 PASS objectStore4 === objectStore2 is false |
26 index3 = objectStore3.index('bar'); | 24 index3 = objectStore3.index('bar'); |
27 index4 = objectStore4.index('bar'); | 25 index4 = objectStore4.index('bar'); |
28 PASS index3 === index4 is true | 26 PASS index3 === index4 is true |
29 PASS index3 === index1 is false | 27 PASS index3 === index1 is false |
30 PASS index4 === index2 is false | 28 PASS index4 === index2 is false |
31 PASS successfullyParsed is true | 29 PASS successfullyParsed is true |
32 | 30 |
33 TEST COMPLETE | 31 TEST COMPLETE |
34 | 32 |
OLD | NEW |