| 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 814987393be25ee3794094cde6bfa487503deea5..4bfaf72caa590ee11ed28ec16ef52db3248e4df2 100644
|
| --- a/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/support.js
|
| +++ b/third_party/WebKit/LayoutTests/external/wpt/IndexedDB/support.js
|
| @@ -62,12 +62,14 @@ function createdb_for_multiple_tests(dbname, version) {
|
| assert_unreached("unexpected open." + evt + " event");
|
| }
|
|
|
| - if (e.target.result + "" == "[object IDBDatabase]" && !this.db) {
|
| - this.db = e.target.result;
|
| -
|
| - this.db.onerror = fail(test, "unexpected db.error");
|
| - this.db.onabort = fail(test, "unexpected db.abort");
|
| - this.db.onversionchange = fail(test, "unexpected db.versionchange");
|
| + if (e.target.result + '' == '[object IDBDatabase]' &&
|
| + !this.db) {
|
| + this.db = e.target.result;
|
| +
|
| + this.db.onerror = fail(test, 'unexpected db.error');
|
| + this.db.onabort = fail(test, 'unexpected db.abort');
|
| + this.db.onversionchange =
|
| + fail(test, 'unexpected db.versionchange');
|
| }
|
| })
|
| })
|
| @@ -102,22 +104,27 @@ function assert_key_equals(actual, expected, description) {
|
| assert_equals(indexedDB.cmp(actual, expected), 0, description);
|
| }
|
|
|
| -function indexeddb_test(upgrade_func, open_func, description) {
|
| - async_test(function(t) {
|
| - var dbname = document.location + '-' + t.name;
|
| - var del = indexedDB.deleteDatabase(dbname);
|
| - del.onerror = t.unreached_func('deleteDatabase should succeed');
|
| - var open = indexedDB.open(dbname, 1);
|
| - open.onerror = t.unreached_func('open should succeed');
|
| - open.onupgradeneeded = t.step_func(function() {
|
| - var db = open.result;
|
| - var tx = open.transaction;
|
| - upgrade_func(t, db, tx);
|
| - });
|
| - open.onsuccess = t.step_func(function() {
|
| - var db = open.result;
|
| - if (open_func)
|
| - open_func(t, db);
|
| - });
|
| - }, description);
|
| +function indexeddb_test(upgrade_func, open_func, description, options) {
|
| + async_test(function(t) {
|
| + var options = Object.assign({upgrade_will_abort: false}, options);
|
| + var dbname = document.location + '-' + t.name;
|
| + var del = indexedDB.deleteDatabase(dbname);
|
| + del.onerror = t.unreached_func('deleteDatabase should succeed');
|
| + var open = indexedDB.open(dbname, 1);
|
| + if (!options.upgrade_will_abort) {
|
| + open.onsuccess = t.unreached_func('open should not succeed');
|
| + } else {
|
| + open.onerror = t.unreached_func('open should succeed');
|
| + }
|
| + open.onupgradeneeded = t.step_func(function() {
|
| + var db = open.result;
|
| + var tx = open.transaction;
|
| + upgrade_func(t, db, tx);
|
| + });
|
| + open.onsuccess = t.step_func(function() {
|
| + var db = open.result;
|
| + if (open_func)
|
| + open_func(t, db);
|
| + });
|
| + }, description);
|
| }
|
|
|