dom/datastore/tests/file_event_receiver.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.

     1 <!DOCTYPE HTML>
     2 <html>
     3 <head>
     4   <meta charset="utf-8">
     5   <title>Test for DataStore - event receiver</title>
     6 </head>
     7 <body>
     8 <script type="application/javascript;version=1.7">
    10   function ok(a, msg) {
    11     alert((a ? 'OK' : 'KO') + ' ' + msg)
    12   }
    14   function is(a, b, msg) {
    15     ok(a === b, msg);
    16   }
    18   function cbError() {
    19     alert('KO error');
    20   }
    22   function finish() {
    23     alert('DONE');
    24   }
    26   function eventListener(evt) {
    27     ok(evt, "OnChangeListener is called with data");
    28     finish();
    29   }
    31   navigator.getDataStores('foo').then(function(stores) {
    32     is(stores.length, 1, "getDataStores('foo') returns 1 element");
    33     is(stores[0].name, 'foo', 'The dataStore.name is foo');
    34     is(stores[0].readOnly, false, 'The dataStore foo is not in readonly');
    36     var store = stores[0];
    37     store.onchange = eventListener;
    38     alert("READY");
    39   });
    41 </script>
    42 </body>
    43 </html>

mercurial