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 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
4 MARIONETTE_TIMEOUT = 60000;
6 SpecialPowers.addPermission("mobileconnection", true, document);
8 // Permission changes can't change existing Navigator.prototype
9 // objects, so grab our objects from a new Navigator
10 let ifr = document.createElement("iframe");
11 let connection;
12 ifr.onload = function() {
13 connection = ifr.contentWindow.navigator.mozMobileConnections[0];
15 ok(connection instanceof ifr.contentWindow.MozMobileConnection,
16 "connection is instanceof " + connection.constructor);
18 testGetCallBarringOption();
19 };
20 document.body.appendChild(ifr);
22 function testGetCallBarringOption() {
23 let option = {'program': 0, 'password': '', 'serviceClass': 0};
24 let request = connection.getCallBarringOption(option);
25 request.onsuccess = function() {
26 ok(request.result);
27 ok('enabled' in request.result, 'should have "enabled" field');
28 cleanUp();
29 };
30 request.onerror = function() {
31 // Call barring is not supported by current emulator.
32 cleanUp();
33 };
34 }
36 function cleanUp() {
37 SpecialPowers.removePermission("mobileconnection", document);
38 finish();
39 }