tizen beta release
[profile/ivi/webkit-efl.git] / LayoutTests / storage / indexeddb / transaction-and-objectstore-calls-expected.txt
1 Test IndexedDB's transaction and objectStore calls
2
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4
5
6 PASS 'webkitIndexedDB' in window is true
7 PASS webkitIndexedDB == null is false
8 webkitIndexedDB.open('transaction-and-objectstore-calls', 'description')
9 db = event.target.result
10 result = db.setVersion('version 1')
11 trans = event.target.result
12 Deleted all object stores.
13 db.createObjectStore('a')
14 db.createObjectStore('b')
15 trans.addEventListener('complete', created, true)
16
17 trans = db.transaction(['a'])
18 trans.objectStore('a')
19 Expecting exception from trans.objectStore('b')
20 PASS Exception was thrown.
21 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
22 Expecting exception from trans.objectStore('x')
23 PASS Exception was thrown.
24 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
25
26 trans = db.transaction(['a'])
27 trans.objectStore('a')
28 Expecting exception from trans.objectStore('b')
29 PASS Exception was thrown.
30 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
31 Expecting exception from trans.objectStore('x')
32 PASS Exception was thrown.
33 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
34
35 trans = db.transaction(['b'])
36 trans.objectStore('b')
37 Expecting exception from trans.objectStore('a')
38 PASS Exception was thrown.
39 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
40 Expecting exception from trans.objectStore('x')
41 PASS Exception was thrown.
42 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
43
44 trans = db.transaction(['a', 'b'])
45 trans.objectStore('a')
46 trans.objectStore('b')
47 Expecting exception from trans.objectStore('x')
48 PASS Exception was thrown.
49 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
50
51 trans = db.transaction(['b', 'a'])
52 trans.objectStore('a')
53 trans.objectStore('b')
54 Expecting exception from trans.objectStore('x')
55 PASS Exception was thrown.
56 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
57
58 Passing a string as the first argument is a shortcut for just one object store:
59 trans = db.transaction('a')
60 trans.objectStore('a')
61 Expecting exception from trans.objectStore('b')
62 PASS Exception was thrown.
63 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
64 Expecting exception from trans.objectStore('x')
65 PASS Exception was thrown.
66 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
67
68 PASS trans = db.transaction() threw exception TypeError: Type error.
69
70 Expecting exception from db.transaction(['x'])
71 PASS Exception was thrown.
72 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
73 Expecting exception from db.transaction(['x'])
74 PASS Exception was thrown.
75 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
76 Expecting exception from db.transaction(['a', 'x'])
77 PASS Exception was thrown.
78 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
79 Expecting exception from db.transaction(['x', 'x'])
80 PASS Exception was thrown.
81 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
82 Expecting exception from db.transaction(['a', 'x', 'b'])
83 PASS Exception was thrown.
84 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
85
86 Exception thrown when no stores specified:
87 Expecting exception from db.transaction([])
88 PASS Exception was thrown.
89 PASS code is DOMException.INVALID_ACCESS_ERR
90
91 {} coerces to a string - so no match, but not a type error:
92 Expecting exception from db.transaction({})
93 PASS Exception was thrown.
94 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
95 Expecting exception from db.transaction({mode:0})
96 PASS Exception was thrown.
97 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
98
99 Overriding the default string coercion makes these work:
100 db.transaction({toString:function(){return 'a';}})
101 db.transaction([{toString:function(){return 'a';}}])
102 ... but you still need to specify a real store:
103 Expecting exception from db.transaction([{toString:function(){return 'x';}}])
104 PASS Exception was thrown.
105 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
106 Expecting exception from db.transaction([{toString:function(){return 'x';}}])
107 PASS Exception was thrown.
108 PASS code is webkitIDBDatabaseException.NOT_FOUND_ERR
109
110 PASS successfullyParsed is true
111
112 TEST COMPLETE
113