OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>IndexedDB: Commit ordering of empty transactions</title> | 2 <title>IndexedDB: Commit ordering of empty transactions</title> |
3 <script src='../../resources/testharness.js'></script> | 3 <script src='../../resources/testharness.js'></script> |
4 <script src='../../resources/testharnessreport.js'></script> | 4 <script src='../../resources/testharnessreport.js'></script> |
5 <script src='resources/testharness-helpers.js'></script> | 5 <script src='resources/testharness-helpers.js'></script> |
6 <script> | 6 <script> |
7 | 7 |
8 function expect(t, expected) { | |
palakj1
2016/06/24 21:36:19
why this test here?
jsbell
2016/06/24 21:37:28
I moved this into testharness-helpers.js since it
| |
9 var results = []; | |
10 return result => { | |
11 results.push(result); | |
12 if (results.length === expected.length) { | |
13 assert_array_equals(results, expected); | |
14 t.done(); | |
15 } | |
16 }; | |
17 } | |
18 | |
19 indexeddb_test( | 8 indexeddb_test( |
20 (t, db) => { | 9 (t, db) => { |
21 db.createObjectStore('store'); | 10 db.createObjectStore('store'); |
22 }, | 11 }, |
23 (t, db) => { | 12 (t, db) => { |
24 var saw = expect(t, ['rq1.onsuccess', | 13 var saw = expect(t, ['rq1.onsuccess', |
25 'rq2.onsuccess', | 14 'rq2.onsuccess', |
26 'tx1.oncomplete', | 15 'tx1.oncomplete', |
27 'tx2.oncomplete']); | 16 'tx2.oncomplete']); |
28 | 17 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 tx3.onabort = t.unreached_func('transaction should commit'); | 65 tx3.onabort = t.unreached_func('transaction should commit'); |
77 tx3.oncomplete = t.step_func(() => saw('tx3.oncomplete')); | 66 tx3.oncomplete = t.step_func(() => saw('tx3.oncomplete')); |
78 | 67 |
79 var rq2 = store.put('b', 2); | 68 var rq2 = store.put('b', 2); |
80 rq2.onsuccess = t.step_func(() => saw('rq2.onsuccess')); | 69 rq2.onsuccess = t.step_func(() => saw('rq2.onsuccess')); |
81 rq2.onerror = t.unreached_func('request should succeed'); | 70 rq2.onerror = t.unreached_func('request should succeed'); |
82 }); | 71 }); |
83 }, | 72 }, |
84 'Multiple transactions without requests complete in the expected order'); | 73 'Multiple transactions without requests complete in the expected order'); |
85 </script> | 74 </script> |
OLD | NEW |