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

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

Issue 2415203002: Indexed DB: More exception precedence tests (Closed)
Patch Set: Review feedback - no more tx pinning, tweaked store create/delete tests to satisfy FF 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
« no previous file with comments | « third_party/WebKit/LayoutTests/storage/indexeddb/idbtransaction-objectStore-exception-order.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a6051db9700eab0b3bc1958091a4d43c8d561db7 100644
--- a/third_party/WebKit/LayoutTests/storage/indexeddb/resources/testharness-helpers.js
+++ b/third_party/WebKit/LayoutTests/storage/indexeddb/resources/testharness-helpers.js
@@ -1,23 +1,23 @@
function indexeddb_test(upgrade_func, body_func, description) {
- async_test(function(t) {
- var dbName = 'db' + self.location.pathname + '-' + description;
- var delete_request = indexedDB.deleteDatabase(dbName);
- delete_request.onerror = t.unreached_func('deleteDatabase should not fail');
- delete_request.onsuccess = t.step_func(function(e) {
- var open_request = indexedDB.open(dbName);
- open_request.onerror = t.unreached_func('open should not fail');
- open_request.onupgradeneeded = t.step_func(function(e) {
- upgrade_func(t, open_request.result);
- });
- open_request.onsuccess = t.step_func(function(e) {
- body_func(t, open_request.result);
- });
- });
- }, description);
+ async_test(function(t) {
+ var dbName = 'db' + self.location.pathname + '-' + description;
+ var delete_request = indexedDB.deleteDatabase(dbName);
+ delete_request.onerror = t.unreached_func('deleteDatabase should not fail');
+ delete_request.onsuccess = t.step_func(function(e) {
+ var open_request = indexedDB.open(dbName);
+ open_request.onerror = t.unreached_func('open should not fail');
+ open_request.onupgradeneeded = t.step_func(function(e) {
+ upgrade_func(t, open_request.result, open_request);
+ });
+ open_request.onsuccess = t.step_func(function(e) {
+ body_func(t, open_request.result);
+ });
+ });
+ }, description);
}
function assert_key_equals(a, b, message) {
- assert_equals(indexedDB.cmp(a, b), 0, message);
+ assert_equals(indexedDB.cmp(a, b), 0, message);
}
// Call with a Test and an array of expected results in order. Returns
@@ -25,12 +25,12 @@ function assert_key_equals(a, b, message) {
// 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();
- }
- };
+ var results = [];
+ return result => {
+ results.push(result);
+ if (results.length === expected.length) {
+ assert_array_equals(results, expected);
+ t.done();
+ }
+ };
}
« no previous file with comments | « third_party/WebKit/LayoutTests/storage/indexeddb/idbtransaction-objectStore-exception-order.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698