mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
938bedb412
--HG-- rename : dom/datastore/tests/test_basic.html => dom/datastore/tests/test_bug924104.html
78 lines
1.3 KiB
HTML
78 lines
1.3 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Test for bug 924104</title>
|
|
</head>
|
|
<body>
|
|
<div id="container"></div>
|
|
<script type="application/javascript;version=1.7">
|
|
|
|
var gStore;
|
|
|
|
function is(a, b, msg) {
|
|
alert((a === b ? 'OK' : 'KO') + ' ' + msg)
|
|
}
|
|
|
|
function ok(a, msg) {
|
|
alert((a ? 'OK' : 'KO')+ ' ' + msg)
|
|
}
|
|
|
|
function cbError() {
|
|
alert('KO error');
|
|
}
|
|
|
|
function finish() {
|
|
alert('DONE');
|
|
}
|
|
|
|
function testGetDataStores() {
|
|
navigator.getDataStores('foo').then(function(stores) {
|
|
gStore = stores[0];
|
|
runTest();
|
|
}, cbError);
|
|
}
|
|
|
|
function testBug924104() {
|
|
gStore
|
|
.add({})
|
|
.then(
|
|
function(index) {
|
|
ok(index, "store.add() created item" + index);
|
|
return gStore.get(index);
|
|
},
|
|
cbError)
|
|
.then(
|
|
function(obj) {
|
|
ok(true, "store.get() works");
|
|
var status = false;
|
|
try {
|
|
obj['foobar'] = 42;
|
|
status = true;
|
|
} catch(e) {}
|
|
ok(status, "Object is editable");
|
|
runTest();
|
|
},
|
|
cbError);
|
|
}
|
|
|
|
var tests = [
|
|
testGetDataStores,
|
|
testBug924104
|
|
];
|
|
|
|
function runTest() {
|
|
if (!tests.length) {
|
|
finish();
|
|
return;
|
|
}
|
|
|
|
var test = tests.shift();
|
|
test();
|
|
}
|
|
|
|
runTest();
|
|
</script>
|
|
</body>
|
|
</html>
|