dom/datastore/tests/file_app_install.html

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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">
     9    function is(a, b, msg) {
    10      alert((a === b ? 'OK' : 'KO') + ' ' + msg)
    11    }
    13    function ok(a, msg) {
    14      alert((a ? 'OK' : 'KO')+ ' ' + msg)
    15    }
    17    function cbError() {
    18      alert('KO error');
    19    }
    21    function finish() {
    22      alert('DONE');
    23    }
    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');
    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