1 Test event propogation on IDBRequest.
3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
6 dbname = "request-event-propagation.html"
7 indexedDB.deleteDatabase(dbname)
9 store = db.createObjectStore('storeName', null)
10 store.add({x: 'value', y: 'zzz'}, 'key')
11 Verify that handler fires and that not preventing default will result in an abort
12 trans = db.transaction(['storeName'], 'readwrite')
13 trans.onabort = transactionAborted
14 trans.oncomplete = unexpectedCompleteCallback
15 trans.onerror = allowDefault
16 store = trans.objectStore('storeName')
17 store.add({x: 'value', y: 'zzz'}, 'key')
18 PASS Event handler fired
19 Doing nothing to prevent the default action...
20 PASS handlerFired is true
23 trans = db.transaction(['storeName'], 'readwrite')
24 trans.onabort = transactionAborted2
25 trans.oncomplete = unexpectedAbortCallback
26 trans.addEventListener('error', errorCaptureCallback, true)
27 trans.addEventListener('error', errorBubbleCallback, false)
28 trans.addEventListener('success', unexpectedSuccessCallback, true)
29 trans.addEventListener('success', unexpectedSuccessCallback, false)
30 db.addEventListener('error', dbErrorCaptureCallback, true)
31 db.addEventListener('error', dbErrorBubbleCallback, false)
32 db.addEventListener('success', unexpectedSuccessCallback, true)
33 db.addEventListener('success', unexpectedSuccessCallback, false)
34 store = trans.objectStore('storeName')
35 store.add({x: 'value', y: 'zzz'}, 'key')
37 In IDBDatabase error capture
38 PASS dbCaptureFired is false
39 PASS captureFired is false
40 PASS requestFired is false
41 PASS bubbleFired is false
42 PASS dbBubbleFired is false
43 PASS event.target is request
44 PASS event.currentTarget is db
46 In IDBTransaction error capture
47 PASS dbCaptureFired is true
48 PASS captureFired is false
49 PASS requestFired is false
50 PASS bubbleFired is false
51 PASS dbBubbleFired is false
52 PASS event.target is request
53 PASS event.currentTarget is trans
56 PASS dbCaptureFired is true
57 PASS captureFired is true
58 PASS requestFired is false
59 PASS bubbleFired is false
60 PASS dbBubbleFired is false
61 PASS event.target is request
62 PASS event.currentTarget is request
64 In IDBTransaction error bubble
65 PASS dbCaptureFired is true
66 PASS captureFired is true
67 PASS requestFired is true
68 PASS bubbleFired is false
69 PASS dbBubbleFired is false
70 PASS event.target is request
71 PASS event.currentTarget is trans
73 In IDBDatabase error bubble
74 PASS dbCaptureFired is true
75 PASS captureFired is true
76 PASS requestFired is true
77 PASS bubbleFired is true
78 PASS dbBubbleFired is false
79 PASS event.target is request
80 PASS event.currentTarget is db
83 PASS dbCaptureFired is true
84 PASS captureFired is true
85 PASS requestFired is true
86 PASS bubbleFired is true
87 PASS dbBubbleFired is true
90 trans = db.transaction(['storeName'], 'readwrite')
91 trans.oncomplete = transactionComplete
92 trans.onabort = unexpectedAbortCallback
93 trans.addEventListener('success', successCaptureCallback, true)
94 trans.addEventListener('success', successBubbleCallback, false)
95 trans.addEventListener('error', unexpectedErrorCallback, true)
96 trans.addEventListener('error', unexpectedErrorCallback, false)
97 db.removeEventListener('error', dbErrorCaptureCallback, true)
98 db.removeEventListener('error', dbErrorBubbleCallback, false)
99 db.removeEventListener('success', unexpectedSuccessCallback, true)
100 db.removeEventListener('success', unexpectedSuccessCallback, false)
101 db.addEventListener('success', dbSuccessCaptureCallback, true)
102 db.addEventListener('success', dbSuccessBubbleCallback, false)
103 db.addEventListener('error', unexpectedErrorCallback, true)
104 db.addEventListener('error', unexpectedErrorCallback, false)
105 store = trans.objectStore('storeName')
106 store.add({x: 'value', y: 'zzz'}, 'key2')
108 In IDBDatabase success capture
109 PASS dbCaptureFired is false
110 PASS captureFired is false
111 PASS requestFired is false
112 PASS bubbleFired is false
113 PASS dbBubbleFired is false
114 PASS event.target is request
115 PASS event.currentTarget is db
117 In IDBTransaction success capture
118 PASS dbCaptureFired is true
119 PASS captureFired is false
120 PASS requestFired is false
121 PASS bubbleFired is false
122 PASS dbBubbleFired is false
123 PASS event.target is request
124 PASS event.currentTarget is trans
126 In IDBRequest handler
127 PASS dbCaptureFired is true
128 PASS captureFired is true
129 PASS requestFired is false
130 PASS bubbleFired is false
131 PASS dbBubbleFired is false
132 PASS event.target is request
133 PASS event.currentTarget is request
135 Transaction completed
136 PASS dbCaptureFired is true
137 PASS captureFired is true
138 PASS requestFired is true
139 PASS bubbleFired is false
140 PASS dbBubbleFired is false
142 PASS successfullyParsed is true