Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(321)

Side by Side Diff: third_party/WebKit/LayoutTests/storage/indexeddb/idbcursor-continue-exception-order.html

Issue 1897253003: IndexedDB: Align exception priorities with Firefox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback: more cases, split files, better messages Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/storage/indexeddb/idbcursor-delete-exception-order.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>IndexedDB: IDBCursor continue() Exception Ordering</title>
3 <link rel="help" href="https://w3c.github.io/IndexedDB/#dom-idbcursor-continue">
4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 <script src="resources/testharness-helpers.js"></script>
7
8 <script>
9
10 indexeddb_test(
11 function(t, db) {
12 var s = db.createObjectStore('s');
13 s.put('value', 'key');
14 },
15 function(t, db) {
16 var s = db.transaction('s', 'readonly').objectStore('s');
17 var r = s.openKeyCursor();
18 r.onsuccess = t.step_func(function() {
19 r.onsuccess = null;
20 var cursor = r.result;
21 setTimeout(t.step_func(function() {
22 assert_throws('TransactionInactiveError', function() {
23 cursor.continue({not: "a valid key"});
24 }, '"Transaction inactive" check (TransactionInactiveError) ' +
25 'should precede "invalid key" check (DataError)');
26 t.done();
27 }), 0);
28 });
29 },
30 'IDBCursor.continue exception order: TransactionInactiveError vs. DataError'
31 );
32
33 indexeddb_test(
34 function(t, db) {
35 var s = db.createObjectStore('s');
36 s.put('value', 'key');
37 },
38 function(t, db) {
39 var s = db.transaction('s', 'readonly').objectStore('s');
40 var r = s.openKeyCursor();
41 r.onsuccess = t.step_func(function() {
42 r.onsuccess = null;
43 var cursor = r.result;
44 cursor.continue();
45 r.onsuccess = t.step_func(function() {
46 setTimeout(t.step_func(function() {
47 assert_throws('TransactionInactiveError', function() {
48 cursor.continue();
49 }, '"Transaction inactive" check (TransactionInactiveError) ' +
50 'should precede "got value flag" check (InvalidStateError )');
51 t.done();
52 }), 0);
53 });
54 });
55 },
56 'IDBCursor.continue exception order: TransactionInactiveError vs. InvalidSta teError'
57 );
58
59 indexeddb_test(
60 function(t, db) {
61 var s = db.createObjectStore('s');
62 s.put('value', 'key');
63 },
64 function(t, db) {
65 var s = db.transaction('s', 'readonly').objectStore('s');
66 var r = s.openKeyCursor();
67 r.onsuccess = t.step_func(function() {
68 r.onsuccess = null;
69 var cursor = r.result;
70 cursor.continue();
71 assert_throws('InvalidStateError', function() {
72 cursor.continue({not: "a valid key"});
73 }, '"got value flag" check (InvalidStateError) should precede ' +
74 '"invalid key" check (DataError)');
75 t.done();
76 });
77 },
78 'IDBCursor.continue exception order: InvalidStateError vs. DataError'
79 );
80
81 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/storage/indexeddb/idbcursor-delete-exception-order.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698