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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/IndexedDB/support.js

Issue 2734533002: IndexedDB: Align abort behavior on uncaught exception with Gecko (Closed)
Patch Set: Test refactors per review Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/external/wpt/IndexedDB/support.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/support.js b/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/support.js
index 63b23e5a73e7af363dd50a9cf407ffb04bc53f8d..9119d828e836ea55ad8f4c1c071a45f652222998 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/support.js
+++ b/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/support.js
@@ -143,3 +143,21 @@ function expect(t, expected) {
}
};
}
+
+// Checks to see if the passed transaction is active (by making
+// requests against the named store).
+function is_transaction_active(tx, store_name) {
+ try {
+ const request = tx.objectStore(store_name).get(0);
+ request.onerror = e => {
+ e.preventDefault();
+ e.stopPropagation();
+ };
+ return true;
+ } catch (ex) {
+ assert_equals(ex.name, 'TransactionInactiveError',
+ 'Active check should either not throw anything, or throw ' +
+ 'TransactionInactiveError');
+ return false;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698