OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <meta charset="utf-8"> | 2 <meta charset="utf-8"> |
3 <title>IDBObjectStore.createIndex() - Event ordering for ConstraintError on requ
est</title> | 3 <title>IDBObjectStore.createIndex() - Event ordering for ConstraintError on requ
est</title> |
4 <link rel="author" href="mailto:odinho@opera.com" title="Odin Hørthe Omdal"> | 4 <link rel="author" href="mailto:odinho@opera.com" title="Odin Hørthe Omdal"> |
5 <meta rel=help href=http://odinho.html5.org/IndexedDB/spec/Overview.html#dfn-ste
ps-for-aborting-a-transaction> | 5 <meta rel=help href=http://odinho.html5.org/IndexedDB/spec/Overview.html#dfn-ste
ps-for-aborting-a-transaction> |
6 <meta rel=assert title="Unless error was set to null, create a DOMError object a
nd set its name to error. Set transaction's error property to this newly created
DOMError."> | 6 <meta rel=assert title="Unless error was set to null, create a DOMError object a
nd set its name to error. Set transaction's error property to this newly created
DOMError."> |
7 <meta rel=assert title="If the transaction's request list contain any requests w
hose done flag is still false, abort the steps for asynchronously executing a re
quest for each such request and queue a task to perform the following steps:"> | 7 <meta rel=assert title="If the transaction's request list contain any requests w
hose done flag is still false, abort the steps for asynchronously executing a re
quest for each such request and queue a task to perform the following steps:"> |
8 <meta rel=assert title="set the request's error attribute to a DOMError with a t
ype of AbortError."> | 8 <meta rel=assert title="set the request's error attribute to a DOMError with a t
ype of AbortError."> |
9 <meta rel=assert title="Dispatch an event at request. The event must use the Eve
nt interface and have its type set to 'error'. The event bubbles and is cancelab
le. The propagation path for the event is transaction's connection, then transac
tion and finally the request. There is no default action for the event."> | 9 <meta rel=assert title="Dispatch an event at request. The event must use the Eve
nt interface and have its type set to 'error'. The event bubbles and is cancelab
le. The propagation path for the event is transaction's connection, then transac
tion and finally the request. There is no default action for the event."> |
10 <meta rel=assert title="Queue up an operation to dispatch an event at transactio
n. The event must use the Event interface and have its type set to 'abort'. The
event does bubble but is not cancelable. The propagation path for the event is t
ransaction's connection and then transaction."> | 10 <meta rel=assert title="Queue up an operation to dispatch an event at transactio
n. The event must use the Event interface and have its type set to 'abort'. The
event does bubble but is not cancelable. The propagation path for the event is t
ransaction's connection and then transaction."> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 rq_add2.onsuccess = log("rq_add2.success"); | 42 rq_add2.onsuccess = log("rq_add2.success"); |
43 rq_add2.onerror = log("rq_add2.error"); | 43 rq_add2.onerror = log("rq_add2.error"); |
44 | 44 |
45 var rq_add3 = objStore.add({ animal: "Horse" }, 3); | 45 var rq_add3 = objStore.add({ animal: "Horse" }, 3); |
46 rq_add3.onsuccess = log("rq_add3.success"); | 46 rq_add3.onsuccess = log("rq_add3.success"); |
47 rq_add3.onerror = log("rq_add3.error"); | 47 rq_add3.onerror = log("rq_add3.error"); |
48 } | 48 } |
49 | 49 |
50 open_rq.onerror = function(e) { | 50 open_rq.onerror = function(e) { |
51 log("open_rq.error")(e); | 51 log("open_rq.error")(e); |
52 assert_object_equals(events, [ "rq_add1.success", | 52 assert_array_equals(events, [ "rq_add1.success", |
53 | 53 |
54 "rq_add2.error: ConstraintError", | 54 "rq_add2.error: ConstraintError", |
55 "transaction.error: ConstraintError", | 55 "transaction.error: ConstraintError", |
56 "db.error: ConstraintError", | 56 "db.error: ConstraintError", |
57 | 57 |
58 "rq_add3.error: AbortError", | 58 "rq_add3.error: AbortError", |
59 "transaction.error: AbortError", | 59 "transaction.error: AbortError", |
60 "db.error: AbortError", | 60 "db.error: AbortError", |
61 | 61 |
62 "transaction.abort: ConstraintError", | 62 "transaction.abort: ConstraintError", |
63 "db.abort: ConstraintError", | 63 "db.abort: ConstraintError", |
64 | 64 |
65 "open_rq.error: AbortError" ], | 65 "open_rq.error: AbortError" ], |
66 "events"); | 66 "events"); |
67 t.done(); | 67 t.done(); |
68 } | 68 } |
69 | 69 |
70 function log(msg) { | 70 function log(msg) { |
71 return function(e) { | 71 return function(e) { |
72 if(e && e.target && e.target.error) | 72 if(e && e.target && e.target.error) |
73 events.push(msg + ": " + e.target.error.name); | 73 events.push(msg + ": " + e.target.error.name); |
74 else | 74 else |
75 events.push(msg); | 75 events.push(msg); |
76 }; | 76 }; |
77 } | 77 } |
78 </script> | 78 </script> |
79 | 79 |
80 <div id="log"></div> | 80 <div id="log"></div> |
OLD | NEW |