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

Unified Diff: third_party/WebKit/LayoutTests/storage/indexeddb/resources/testharness-helpers.js

Issue 2415203002: Indexed DB: More exception precedence tests (Closed)
Patch Set: Created 4 years, 2 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/storage/indexeddb/resources/testharness-helpers.js
diff --git a/third_party/WebKit/LayoutTests/storage/indexeddb/resources/testharness-helpers.js b/third_party/WebKit/LayoutTests/storage/indexeddb/resources/testharness-helpers.js
index 846481f55bb877737446463029967f3760967bc1..c4de2f0ffff33749cdb8a09657e3bf2d383551e1 100644
--- a/third_party/WebKit/LayoutTests/storage/indexeddb/resources/testharness-helpers.js
+++ b/third_party/WebKit/LayoutTests/storage/indexeddb/resources/testharness-helpers.js
@@ -34,3 +34,20 @@ function expect(t, expected) {
}
};
}
+
+// Pins the transaction associated with the given store open by
+// issuing a chain of get(0) requests. Returns a function to call to
+// stop the requests and let the transaction complete. Useful when you
+// need to ensure a transaction is alive across other asynchronous
+// operations (e.g. setTimeout)
+function pin_transaction(store) {
pwnall 2016/10/14 07:57:05 The docs do state that the point of it is to keep
jsbell 2016/10/17 19:42:04 Agreed, but...
+ let finish = false;
+ (function spin() {
+ if (finish)
+ return;
+ store.get(0).onsuccess = spin;
+ }());
+ return () => {
+ finish = true;
+ };
+}

Powered by Google App Engine
This is Rietveld 408576698