gecko/dom/datastore/tests/file_bug1008044.html
Andrea Marchesini 601228fc42 Bug 1008044 - DataStoreServiceChild should check the name of the DataStore before resolving the promise callback, r=ehsan, f=kgrandon
--HG--
rename : dom/datastore/tests/test_oop.html => dom/datastore/tests/test_bug1008044.html
2014-05-22 12:12:15 +01:00

47 lines
826 B
HTML

<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Test for DataStore - bug 1008044</title>
</head>
<body>
<div id="container"></div>
<script type="application/javascript;version=1.7">
function ok(a, msg) {
alert((!!a ? 'OK' : 'KO') + ' ' + msg)
}
function cbError() {
alert('KO error');
}
function finish() {
alert('DONE');
}
navigator.getDataStores('foo').then(function(stores) {
if (stores[0].name != 'foo') {
ok(false, "Wrong name is received! Expected 'foo'");
}
runTest();
});
navigator.getDataStores('bar').then(function(stores) {
if (stores[0].name != 'bar') {
ok(false, "Wrong name is received! Expected 'bar'");
}
runTest();
});
var pending = 2;
function runTest() {
if (--pending == 0) {
ok(true, "Test passed!");
finish();
}
}
</script>
</body>
</html>