mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
c501baa0a3
--HG-- rename : dom/indexedDB/test/unit/bug1056939.zip => dom/indexedDB/test/unit/bug1056939_profile.zip
87 lines
2.8 KiB
HTML
87 lines
2.8 KiB
HTML
<!--
|
|
Any copyright is dedicated to the Public Domain.
|
|
http://creativecommons.org/publicdomain/zero/1.0/
|
|
-->
|
|
<html>
|
|
<head>
|
|
<title>Indexed Database Test</title>
|
|
|
|
<script type="text/javascript;version=1.7">
|
|
let db;
|
|
let version = window.location.href.charAt(window.location.href.length - 1);
|
|
|
|
function onAddMore() {
|
|
let transaction = db.transaction("foo", "readwrite");
|
|
|
|
transaction.oncomplete = function(event) {
|
|
setTimeout(testFinishedCallback, 0, "complete");
|
|
}
|
|
transaction.onabort = function(event) {
|
|
setTimeout(testFinishedCallback, 0, "abort " + event.target.error.name);
|
|
}
|
|
|
|
let objectStore = transaction.objectStore("foo");
|
|
let obj = {
|
|
foo: " ",
|
|
bar: " ",
|
|
baz: " "
|
|
};
|
|
for (let i = 0; i < 1000; i++) {
|
|
objectStore.add(obj).onerror = errorHandler;
|
|
}
|
|
}
|
|
|
|
function onDone() {
|
|
window.removeEventListener("indexedDB-addMore", onAddMore, true);
|
|
window.removeEventListener("indexedDB-done", onDone, true);
|
|
|
|
let request =
|
|
indexedDB.open(window.location.pathname, { version: version++,
|
|
storage: "persistent" });
|
|
request.onerror = errorHandler;
|
|
request.onupgradeneeded = function(event) {
|
|
db.deleteObjectStore("foo");
|
|
db.onversionchange = function () { db.close(); };
|
|
request.transaction.oncomplete = function(event) {
|
|
testResult = "finished";
|
|
testException = undefined;
|
|
finishTest();
|
|
}
|
|
}
|
|
}
|
|
|
|
function testSteps()
|
|
{
|
|
const name = window.location.pathname;
|
|
|
|
window.addEventListener("indexedDB-addMore", onAddMore, true);
|
|
window.addEventListener("indexedDB-done", onDone, true);
|
|
|
|
let request = indexedDB.open(name, { version: version++,
|
|
storage: "persistent" });
|
|
request.onerror = errorHandler;
|
|
request.onupgradeneeded = grabEventAndContinueHandler;
|
|
let event = yield undefined;
|
|
|
|
db = event.target.result;
|
|
|
|
db.onversionchange = function () { db.close(); };
|
|
|
|
db.createObjectStore("foo", { autoIncrement: true });
|
|
|
|
request.onsuccess = grabEventAndContinueHandler;
|
|
yield undefined;
|
|
|
|
setTimeout(testFinishedCallback, 0, "ready");
|
|
yield undefined;
|
|
}
|
|
</script>
|
|
|
|
<script type="text/javascript;version=1.7" src="browserHelpers.js"></script>
|
|
|
|
</head>
|
|
|
|
<body onload="runTest();" onunload="finishTestNow();"></body>
|
|
|
|
</html>
|