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.
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <title>Test for Battery API</title>
5 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
7 </head>
8 <body>
9 <p id="display"></p>
10 <div id="content" style="display: none">
11 </div>
12 <pre id="test">
13 <script type="application/javascript">
15 /** Test for Battery API **/
17 ok('battery' in navigator, "navigator.battery should exist");
19 var battery = navigator.battery;
20 ok(battery.level >= 0.0 && battery.level <= 1.0, "Battery level " + battery.level + " should be in the range [0.0, 1.0]");
22 if (battery.charging) {
23 ok(battery.chargingTime >= 0, "Battery chargingTime " + battery.chargingTime + " should be nonnegative when charging");
24 is(battery.dischargingTime, Infinity, "Battery dischargingTime should be Infinity when charging");
25 } else {
26 is(battery.chargingTime, Infinity, "Battery chargingTime should be Infinity when discharging");
27 ok(battery.dischargingTime > 0, "Battery dischargingTime " + battery.dischargingTime + " should be positive when discharging");
28 }
30 </script>
31 </pre>
32 </body>
33 </html>