Skip to content

Commit

Permalink
Make IndexedDB/support.js work in workers
Browse files Browse the repository at this point in the history
This should fix the test
html/infrastructure/safe-passing-of-structured-data/shared-array-buffers/serialization-via-idb.any.worker.html

Part of #11269.
  • Loading branch information
zcorpan committed Jun 5, 2018
1 parent e4fd758 commit 37a3b3d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions IndexedDB/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
});
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 37a3b3d

Please sign in to comment.