| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <title>IDBTransaction</title> | |
| 3 <link rel="author" href="mailto:odinho@opera.com" title="Odin Hørthe Omdal"> | |
| 4 <script src="../../../resources/testharness.js"></script> | |
| 5 <script src="../../../resources/testharnessreport.js"></script> | |
| 6 <script src="support.js"></script> | |
| 7 | |
| 8 <script> | |
| 9 var db, | |
| 10 t = async_test(document.title + " - request gotten by the handler"), | |
| 11 open_t = async_test(document.title + " - request returned by open()"), | |
| 12 | |
| 13 open_rq = indexedDB.open("idbtransaction-" + new Date().getTime() + Math.ran
dom()); | |
| 14 | |
| 15 open_t.step(function() { | |
| 16 assert_equals(open_rq.transaction, null, "IDBOpenDBRequest.transaction")
; | |
| 17 assert_equals(open_rq.source, null, "IDBOpenDBRequest.source"); | |
| 18 assert_equals(open_rq.readyState, "pending", "IDBOpenDBRequest.readyStat
e"); | |
| 19 | |
| 20 assert_true(open_rq instanceof IDBOpenDBRequest, "open_rq instanceof IDB
OpenDBRequest"); | |
| 21 assert_equals(open_rq + "", "[object IDBOpenDBRequest]", "IDBOpenDBReque
st (open_rq)"); | |
| 22 | |
| 23 open_t.done(); | |
| 24 }); | |
| 25 | |
| 26 open_rq.onupgradeneeded = t.step_func(function(e) { | |
| 27 assert_equals(e.target, open_rq, "e.target is reusing the same IDBOpenDB
Request"); | |
| 28 assert_equals(e.target.transaction, open_rq.transaction, "IDBOpenDBReque
st.transaction"); | |
| 29 | |
| 30 assert_true(e.target.transaction instanceof IDBTransaction, "transaction
instanceof IDBTransaction"); | |
| 31 t.done(); | |
| 32 }); | |
| 33 | |
| 34 | |
| 35 // Not plausible conditions... | |
| 36 function fail_helper(name) { | |
| 37 return function() { | |
| 38 t.step(function() { assert_unreached(name); }); | |
| 39 open_t.step(function() { assert_unreached(name); }); | |
| 40 }; | |
| 41 } | |
| 42 open_rq.onblocked = fail_helper('open_rq.onblocked'); | |
| 43 open_rq.onerror = fail_helper('open_rq.onerror'); | |
| 44 </script> | |
| 45 | |
| 46 <div id="log"></div> | |
| OLD | NEW |