Revision a78790aeb8417fb65c61a74ca82aea5f1e7c63ff authored by James Graham on 28 March 2014, 16:19:44 UTC, committed by James Graham on 28 March 2014, 16:19:44 UTC
1 parent a4e2797
idbfactory_open6.htm
<!DOCTYPE html>
<html>
<head>
<title>IDBFactory.open() - open database with a lower version than current</title>
<script type="text/javascript" src="support.js"></script>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script type="text/javascript">
var t = async_test();
function RunTest() {
databaseVersion = 3;
var rqOpen = window.indexedDB.open(databaseName, databaseVersion);
rqOpen.onupgradeneeded = t.step_func( function(event) {
event.target.result.close();
});
rqOpen.onsuccess = t.step_func( OpenDatabaseWithPreviousVersion );
rqOpen.onerror = t.step_func( assert_open_request_error );
}
function OpenDatabaseWithPreviousVersion() {
var rqOpen = window.indexedDB.open(databaseName, databaseVersion - 1);
rqOpen.onsuccess = t.step_func( function (event) { assert_unexpected_success(); });
rqOpen.onupgradeneeded = t.step_func( function (event) { assert_unexpected_upgradeneeded(); } );
rqOpen.onerror = t.step_func(function (event) {
assert_equals(event.target.error.name, "VersionError", "event.target.error.name");
t.done();
});
}
setup(function() {
var rqDelete = window.indexedDB.deleteDatabase(databaseName);
rqDelete.onsuccess = t.step_func( RunTest );
});
</script>
</head>
<body>
<div id="log">
</div>
</body>
</html>
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...