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

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

Issue 2084053004: IndexedDB: Defer delete calls when there is a running upgrade (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased, made delete lists contain unique_ptrs Created 4 years, 5 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 ceec0aa8a901397daa568aea6dfbadf31515360e..846481f55bb877737446463029967f3760967bc1 100644
--- a/third_party/WebKit/LayoutTests/storage/indexeddb/resources/testharness-helpers.js
+++ b/third_party/WebKit/LayoutTests/storage/indexeddb/resources/testharness-helpers.js
@@ -19,3 +19,18 @@ function indexeddb_test(upgrade_func, body_func, description) {
function assert_key_equals(a, b, message) {
assert_equals(indexedDB.cmp(a, b), 0, message);
}
+
+// Call with a Test and an array of expected results in order. Returns
+// a function; call the function when a result arrives and when the
+// expected number appear the order will be asserted and test
+// completed.
+function expect(t, expected) {
+ var results = [];
+ return result => {
+ results.push(result);
+ if (results.length === expected.length) {
+ assert_array_equals(results, expected);
+ t.done();
+ }
+ };
+}

Powered by Google App Engine
This is Rietveld 408576698