Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
michael@0 | 1 | <!-- |
michael@0 | 2 | Any copyright is dedicated to the Public Domain. |
michael@0 | 3 | http://creativecommons.org/publicdomain/zero/1.0/ |
michael@0 | 4 | --> |
michael@0 | 5 | <!DOCTYPE HTML> |
michael@0 | 6 | <html> |
michael@0 | 7 | <!-- |
michael@0 | 8 | https://bugzilla.mozilla.org/show_bug.cgi?id=717103 |
michael@0 | 9 | --> |
michael@0 | 10 | <head> |
michael@0 | 11 | <title>Test for basic sanity of the device storage API </title> |
michael@0 | 12 | <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 13 | <script type="text/javascript" src="devicestorage_common.js"></script> |
michael@0 | 14 | |
michael@0 | 15 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
michael@0 | 16 | </head> |
michael@0 | 17 | <body> |
michael@0 | 18 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=717103">Mozilla Bug 717103</a> |
michael@0 | 19 | <p id="display"></p> |
michael@0 | 20 | <div id="content" style="display: none"> |
michael@0 | 21 | |
michael@0 | 22 | </div> |
michael@0 | 23 | <pre id="test"> |
michael@0 | 24 | <script class="testbody" type="text/javascript"> |
michael@0 | 25 | |
michael@0 | 26 | devicestorage_setup() |
michael@0 | 27 | |
michael@0 | 28 | storage = navigator.getDeviceStorage("pictures"); |
michael@0 | 29 | |
michael@0 | 30 | |
michael@0 | 31 | throws = false; |
michael@0 | 32 | try { |
michael@0 | 33 | var cursor = storage.enumerate(); |
michael@0 | 34 | } catch(e) {throws = true} |
michael@0 | 35 | ok(!throws, "enumerate no parameter"); |
michael@0 | 36 | |
michael@0 | 37 | throws = false; |
michael@0 | 38 | try { |
michael@0 | 39 | var cursor = storage.enumerate("string"); |
michael@0 | 40 | } catch(e) {throws = true} |
michael@0 | 41 | ok(!throws, "enumerate one string parameter"); |
michael@0 | 42 | |
michael@0 | 43 | throws = false; |
michael@0 | 44 | try { |
michael@0 | 45 | var cursor = storage.enumerate("string", "string2"); |
michael@0 | 46 | } catch(e) {throws = true} |
michael@0 | 47 | ok(throws, "enumerate two string parameter"); |
michael@0 | 48 | |
michael@0 | 49 | throws = false; |
michael@0 | 50 | try { |
michael@0 | 51 | var cursor = storage.enumerate("string", {"since": new Date(1)}); |
michael@0 | 52 | } catch(e) {throws = true} |
michael@0 | 53 | ok(!throws, "enumerate a string and object parameter"); |
michael@0 | 54 | |
michael@0 | 55 | throws = false; |
michael@0 | 56 | try { |
michael@0 | 57 | var cursor = storage.enumerate({"path": "a"}); |
michael@0 | 58 | } catch(e) {throws = true} |
michael@0 | 59 | ok(!throws, "enumerate object parameter with path"); |
michael@0 | 60 | |
michael@0 | 61 | throws = false; |
michael@0 | 62 | try { |
michael@0 | 63 | var cursor = storage.enumerate({}, "string"); |
michael@0 | 64 | } catch(e) {throws = true} |
michael@0 | 65 | ok(throws, "enumerate object then a string"); |
michael@0 | 66 | |
michael@0 | 67 | throws = false; |
michael@0 | 68 | try { |
michael@0 | 69 | var cursor = storage.enumerate({"path": "a", "since": new Date(0) }); |
michael@0 | 70 | } catch(e) {throws = true} |
michael@0 | 71 | ok(!throws, "enumerate object parameter with path"); |
michael@0 | 72 | |
michael@0 | 73 | |
michael@0 | 74 | |
michael@0 | 75 | |
michael@0 | 76 | devicestorage_cleanup() |
michael@0 | 77 | </script> |
michael@0 | 78 | </pre> |
michael@0 | 79 | </body> |
michael@0 | 80 | </html> |
michael@0 | 81 |