1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/datastore/tests/file_event_maker.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,32 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<head> 1.7 + <meta charset="utf-8"> 1.8 + <title>Test for DataStore - event maker</title> 1.9 +</head> 1.10 +<body> 1.11 +<script type="application/javascript;version=1.7"> 1.12 + 1.13 + function is(a, b, msg) { 1.14 + alert((a === b ? 'OK' : 'KO') + ' ' + msg) 1.15 + } 1.16 + 1.17 + function cbError() { 1.18 + alert('KO error'); 1.19 + } 1.20 + 1.21 + function finish() { 1.22 + alert('DONE'); 1.23 + } 1.24 + 1.25 + navigator.getDataStores('foo').then(function(stores) { 1.26 + is(stores.length, 1, "getDataStores('foo') returns 1 element"); 1.27 + is(stores[0].name, 'foo', 'The dataStore.name is foo'); 1.28 + is(stores[0].readOnly, false, 'The dataStore foo is not in readonly'); 1.29 + stores[0].add({a: 42}).then(finish, cbError); 1.30 + }); 1.31 + 1.32 +</script> 1.33 +</body> 1.34 +</html> 1.35 +