OLD | NEW |
1 Test IndexedDB's create and removeObjectStore | 1 Test IndexedDB's create and removeObjectStore |
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 = "create-and-remove-object-store.html" | 8 dbname = "create-and-remove-object-store.html" |
9 indexedDB.deleteDatabase(dbname) | 9 indexedDB.deleteDatabase(dbname) |
10 indexedDB.open(dbname) | 10 indexedDB.open(dbname) |
11 db.createObjectStore('tmp') | 11 db.createObjectStore('tmp') |
12 Expecting exception from db.createObjectStore('tmp') | 12 Expecting exception from db.createObjectStore('tmp') |
13 PASS Exception was thrown. | 13 PASS Exception was thrown. |
14 PASS code is 0 | 14 PASS code is 0 |
15 PASS ename is 'ConstraintError' | 15 PASS ename is 'ConstraintError' |
| 16 Exception message: An object store with the specified name already exists. |
16 trans = db.transaction(['tmp']) | 17 trans = db.transaction(['tmp']) |
17 trans.objectStore('tmp').get(0) | 18 trans.objectStore('tmp').get(0) |
18 PASS event.target.result is undefined. | 19 PASS event.target.result is undefined. |
19 Trying create | 20 Trying create |
20 Expecting exception from db.createObjectStore("some os") | 21 Expecting exception from db.createObjectStore("some os") |
21 PASS Exception was thrown. | 22 PASS Exception was thrown. |
22 PASS code is DOMException.INVALID_STATE_ERR | 23 PASS code is DOMException.INVALID_STATE_ERR |
23 PASS ename is 'InvalidStateError' | 24 PASS ename is 'InvalidStateError' |
| 25 Exception message: The database is not running a version change transaction. |
24 Trying remove | 26 Trying remove |
25 Expecting exception from db.deleteObjectStore("some os") | 27 Expecting exception from db.deleteObjectStore("some os") |
26 PASS Exception was thrown. | 28 PASS Exception was thrown. |
27 PASS code is DOMException.INVALID_STATE_ERR | 29 PASS code is DOMException.INVALID_STATE_ERR |
28 PASS ename is 'InvalidStateError' | 30 PASS ename is 'InvalidStateError' |
| 31 Exception message: The database is not running a version change transaction. |
29 Trying create with store that already exists | 32 Trying create with store that already exists |
30 Expecting exception from db.createObjectStore('tmp') | 33 Expecting exception from db.createObjectStore('tmp') |
31 PASS Exception was thrown. | 34 PASS Exception was thrown. |
32 PASS code is DOMException.INVALID_STATE_ERR | 35 PASS code is DOMException.INVALID_STATE_ERR |
33 PASS ename is 'InvalidStateError' | 36 PASS ename is 'InvalidStateError' |
| 37 Exception message: The database is not running a version change transaction. |
34 Trying remove with store that already exists | 38 Trying remove with store that already exists |
35 Expecting exception from db.deleteObjectStore('tmp') | 39 Expecting exception from db.deleteObjectStore('tmp') |
36 PASS Exception was thrown. | 40 PASS Exception was thrown. |
37 PASS code is DOMException.INVALID_STATE_ERR | 41 PASS code is DOMException.INVALID_STATE_ERR |
38 PASS ename is 'InvalidStateError' | 42 PASS ename is 'InvalidStateError' |
| 43 Exception message: The database is not running a version change transaction. |
39 PASS successfullyParsed is true | 44 PASS successfullyParsed is true |
40 | 45 |
41 TEST COMPLETE | 46 TEST COMPLETE |
42 | 47 |
OLD | NEW |