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