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

Side by Side Diff: third_party/WebKit/LayoutTests/external/wpt/IndexedDB/error-attributes.html

Issue 2664623002: Upstream an assortment of IndexedDB tests to WPT. (Closed)
Patch Set: Rebase MANIFEST.json. Created 3 years, 10 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/external/wpt/IndexedDB/idbcursor-advance-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
1 <!DOCTYPE html> 1 <!doctype html>
2 <meta charset=utf-8>
2 <title>IndexedDB: Error attributes are DOMExceptions</title> 3 <title>IndexedDB: Error attributes are DOMExceptions</title>
3 <script src="../../resources/testharness.js"></script> 4 <link rel="help" href="https://w3c.github.io/IndexedDB/#idbrequest">
4 <script src="../../resources/testharnessreport.js"></script> 5 <script src="/resources/testharness.js"></script>
5 <script src="resources/testharness-helpers.js"></script> 6 <script src="/resources/testharnessreport.js"></script>
7 <script src="support.js"></script>
6 <script> 8 <script>
9
7 indexeddb_test( 10 indexeddb_test(
8 function(t, db) { 11 function(t, db) {
9 db.createObjectStore('store'); 12 db.createObjectStore('store');
10 }, 13 },
11 function(t, db) { 14 function(t, db) {
12 var tx = db.transaction('store', 'readwrite'); 15 var tx = db.transaction('store', 'readwrite');
13 var store = tx.objectStore('store'); 16 var store = tx.objectStore('store');
14 var r1 = store.add('value', 'key'); 17 var r1 = store.add('value', 'key');
15 r1.onerror = t.unreached_func('first add should succeed'); 18 r1.onerror = t.unreached_func('first add should succeed');
16 19
17 var r2 = store.add('value', 'key'); 20 var r2 = store.add('value', 'key');
18 r2.onsuccess = t.unreached_func('second add should fail'); 21 r2.onsuccess = t.unreached_func('second add should fail');
19 22
20 r2.onerror = t.step_func(function() { 23 r2.onerror = t.step_func(function() {
21 assert_true(r2.error instanceof DOMException); 24 assert_true(r2.error instanceof DOMException);
22 assert_equals(r2.error.name, 'ConstraintError'); 25 assert_equals(r2.error.name, 'ConstraintError');
23 }); 26 });
24 27
25 tx.oncomplete = t.unreached_func('transaction should not complete'); 28 tx.oncomplete = t.unreached_func('transaction should not complete');
26 tx.onabort = t.step_func(function() { 29 tx.onabort = t.step_func(function() {
27 assert_true(tx.error instanceof DOMException); 30 assert_true(tx.error instanceof DOMException);
28 assert_equals(tx.error.name, 'ConstraintError'); 31 assert_equals(tx.error.name, 'ConstraintError');
29 t.done(); 32 t.done();
30 }); 33 });
31 }, 34 },
32 'IDBRequest and IDBTransaction error properties should be DOMExceptions' 35 'IDBRequest and IDBTransaction error properties should be DOMExceptions'
33 ); 36 );
37
34 </script> 38 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/IndexedDB/idbcursor-advance-exception-order.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698