dom/datastore/tests/file_app_install.html

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:5c406cadb10b
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <meta charset="utf-8">
5 <title>Test for DataStore - install/uninstall apps</title>
6 <body>
7 <script type="application/javascript;version=1.7">
8
9 function is(a, b, msg) {
10 alert((a === b ? 'OK' : 'KO') + ' ' + msg)
11 }
12
13 function ok(a, msg) {
14 alert((a ? 'OK' : 'KO')+ ' ' + msg)
15 }
16
17 function cbError() {
18 alert('KO error');
19 }
20
21 function finish() {
22 alert('DONE');
23 }
24
25 navigator.getDataStores('foo').then(function(stores) {
26 is(stores.length, 1, "getDataStores('foo') returns 1 element");
27 is(stores[0].name, 'foo', 'The dataStore.name is foo');
28 ok(stores[0].owner, 'The dataStore.owner exists');
29 is(stores[0].readOnly, false, 'The dataStore foo is not in readonly');
30
31 navigator.getDataStores('bar').then(function(stores) {
32 is(stores.length, 1, "getDataStores('bar') returns 1 element");
33 is(stores[0].name, 'bar', 'The dataStore.name is bar');
34 ok(stores[0].owner, 'The dataStore.owner exists');
35 is(stores[0].readOnly, false, 'The dataStore bar is in readonly');
36 finish();
37 }, cbError);
38 }, cbError);
39 </script>
40 </html>

mercurial