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

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

Issue 1087923003: Indexed DB: Adopt BufferSource model for binary keys (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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: LayoutTests/storage/indexeddb/resources/testharness-helpers.js
diff --git a/LayoutTests/storage/indexeddb/resources/testharness-helpers.js b/LayoutTests/storage/indexeddb/resources/testharness-helpers.js
new file mode 100644
index 0000000000000000000000000000000000000000..9e8892d6706ed14cef434ba7545eb256f9ff84e8
--- /dev/null
+++ b/LayoutTests/storage/indexeddb/resources/testharness-helpers.js
@@ -0,0 +1,21 @@
+function idb_test(description, onUpgrade, onOpen) {
+ async_test(function(t) {
+ var dbName = 'db' + location.pathname + '-' + description;
+ var deleteRequest = indexedDB.deleteDatabase(dbName);
+ deleteRequest.onerror = t.unreached_func('deleteDatabase should not fail');
+ deleteRequest.onsuccess = t.step_func(function(e) {
+ var openRequest = indexedDB.open(dbName);
+ openRequest.onerror = t.unreached_func('open should not fail');
+ openRequest.onupgradeneeded = t.step_func(function(e) {
+ onUpgrade(t, openRequest.result);
+ });
+ openRequest.onsuccess = t.step_func(function(e) {
+ onOpen(t, openRequest.result);
+ });
+ });
+ }, description);
+}
+
+function assert_key_equals(a, b, message) {
+ assert_equals(indexedDB.cmp(a, b), 0, message);
cmumford 2015/04/27 17:14:23 expected is first argument.
+}

Powered by Google App Engine
This is Rietveld 408576698