From 718819e5652caff418b8c55813d0be5537d45788 Mon Sep 17 00:00:00 2001 From: Simon Pieters Date: Mon, 25 Jun 2018 22:00:00 +0000 Subject: [PATCH] Bug 1466796 [wpt PR 11348] - Make IndexedDB/support.js work in workers, a=testonly Automatic update from web-platform-testsMake IndexedDB/support.js work in workers This should fix the test html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-idb.any.worker.html Part of #11269. -- wpt-commits: 60a937de7bd20eb1890893a48423a79b096866d8 wpt-pr: 11348 --- testing/web-platform/meta/MANIFEST.json | 2 +- testing/web-platform/tests/IndexedDB/support.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index 19494f83fd2b..99025500854b 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -411079,7 +411079,7 @@ "support" ], "IndexedDB/support.js": [ - "1a2e89e3be7ba2af3352d5d284666465a5663fb5", + "df25e578a049e65114cedd280d3d7faf5685c09c", "support" ], "IndexedDB/transaction-abort-generator-revert.html": [ diff --git a/testing/web-platform/tests/IndexedDB/support.js b/testing/web-platform/tests/IndexedDB/support.js index ac9c2f324194..5edbdacbcc7d 100644 --- a/testing/web-platform/tests/IndexedDB/support.js +++ b/testing/web-platform/tests/IndexedDB/support.js @@ -12,7 +12,7 @@ add_completion_callback(function(tests) if(tests[i].db) { tests[i].db.close(); - window.indexedDB.deleteDatabase(tests[i].db.name); + self.indexedDB.deleteDatabase(tests[i].db.name); } } }); @@ -43,9 +43,9 @@ function createdb_for_multiple_tests(dbname, version) { dbname = (dbname ? dbname : "testdb-" + new Date().getTime() + Math.random() ); if (version) - rq_open = window.indexedDB.open(dbname, version); + rq_open = self.indexedDB.open(dbname, version); else - rq_open = window.indexedDB.open(dbname); + rq_open = self.indexedDB.open(dbname); function auto_fail(evt, current_test) { /* Fail handlers, if we haven't set on/whatever/, don't @@ -107,7 +107,7 @@ function assert_key_equals(actual, expected, description) { function indexeddb_test(upgrade_func, open_func, description, options) { async_test(function(t) { options = Object.assign({upgrade_will_abort: false}, options); - var dbname = document.location + '-' + t.name; + var dbname = location + '-' + t.name; var del = indexedDB.deleteDatabase(dbname); del.onerror = t.unreached_func('deleteDatabase should succeed'); var open = indexedDB.open(dbname, 1);