Thu, 22 Jan 2015 13:21:57 +0100
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 - 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>