blob: 213334c88db574259b0664fcab9ea35720a25e49 [file] [log] [blame]
if (this.importScripts) {
importScripts('../../../resources/js-test.js');
importScripts('shared.js');
}
description("Regression test for WK136583 - ensure the versionchange event has the proper name");
indexedDBTest(prepareDatabase, upgradeDatabase);
function prepareDatabase(evt)
{
db = event.target.result;
evalAndLog("db.onversionchange = onVersionChange");
evalAndLog("store = db.createObjectStore('store1')");
}
function upgradeDatabase(evt)
{
db = evt.target.result;
shouldBe("db.version", "1");
evalAndLog("request = indexedDB.open(dbname, 2)");
evalAndLog("db.onversionchange = onVersionChange");
request.onerror = unexpectedErrorCallback;
request.onsuccess = finishTest;
}
function onVersionChange(evt)
{
preamble(evt);
shouldBeEqualToString("event.type", "versionchange");
db.close();
}
function finishTest(evt)
{
finishJSTest();
}