dom/datastore/tests/file_app_install.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial