Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <meta charset="utf-8"> |
michael@0 | 5 | <title>Test for DataStore - event maker</title> |
michael@0 | 6 | </head> |
michael@0 | 7 | <body> |
michael@0 | 8 | <script type="application/javascript;version=1.7"> |
michael@0 | 9 | |
michael@0 | 10 | function is(a, b, msg) { |
michael@0 | 11 | alert((a === b ? 'OK' : 'KO') + ' ' + msg) |
michael@0 | 12 | } |
michael@0 | 13 | |
michael@0 | 14 | function cbError() { |
michael@0 | 15 | alert('KO error'); |
michael@0 | 16 | } |
michael@0 | 17 | |
michael@0 | 18 | function finish() { |
michael@0 | 19 | alert('DONE'); |
michael@0 | 20 | } |
michael@0 | 21 | |
michael@0 | 22 | navigator.getDataStores('foo').then(function(stores) { |
michael@0 | 23 | is(stores.length, 1, "getDataStores('foo') returns 1 element"); |
michael@0 | 24 | is(stores[0].name, 'foo', 'The dataStore.name is foo'); |
michael@0 | 25 | is(stores[0].readOnly, false, 'The dataStore foo is not in readonly'); |
michael@0 | 26 | stores[0].add({a: 42}).then(finish, cbError); |
michael@0 | 27 | }); |
michael@0 | 28 | |
michael@0 | 29 | </script> |
michael@0 | 30 | </body> |
michael@0 | 31 | </html> |
michael@0 | 32 |