Bug 846200 - Update Marionette JS WebAPI Tests to use new settings-api permissions; r=echou r=echen
authorKyle Machulis <kyle@nonpolynomial.com>
Wed, 27 Aug 2014 21:01:29 -0700
changeset 202319 3ecbe14009fbe0fbabc7a7f6cf0b41eeafe3f494
parent 202318 565b3b3526a7d39716f71bb27f7ff48c398ca28e
child 202320 ab60d3c61f55ecfdf29c430c740abbabb98e9e1c
push id10168
push userkmachulis@mozilla.com
push dateFri, 29 Aug 2014 07:39:33 +0000
treeherderb2g-inbound@ab60d3c61f55 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersechou, echen
bugs846200
milestone34.0a1
Bug 846200 - Update Marionette JS WebAPI Tests to use new settings-api permissions; r=echou r=echen
dom/bluetooth/tests/marionette/head.js
dom/bluetooth/tests/marionette/test_dom_BluetoothManager_enabled.js
dom/bluetooth2/tests/marionette/test_dom_BluetoothManager_API2.js
dom/fmradio/test/marionette/test_bug876597.js
dom/mobileconnection/tests/marionette/test_dsds_mobile_data_connection.js
dom/mobileconnection/tests/marionette/test_mobile_data_connection.js
dom/mobileconnection/tests/marionette/test_mobile_data_ipv6.js
dom/mobileconnection/tests/marionette/test_mobile_set_radio.js
dom/tethering/tests/marionette/head.js
dom/wifi/test/marionette/head.js
--- a/dom/bluetooth/tests/marionette/head.js
+++ b/dom/bluetooth/tests/marionette/head.js
@@ -721,17 +721,17 @@ function startBluetoothTestBase(aPermiss
     .then(aTestCaseMain)
     .then(cleanUp, function() {
       ok(false, "Unhandled rejected promise.");
       cleanUp();
     });
 }
 
 function startBluetoothTest(aReenable, aTestCaseMain) {
-  startBluetoothTestBase(["settings-read", "settings-write"], function() {
+  startBluetoothTestBase(["settings-read", "settings-write", "settings-api-read", "settings-api-write"], function() {
     let origEnabled, needEnable;
 
     return getBluetoothEnabled()
       .then(function(aEnabled) {
         origEnabled = aEnabled;
         needEnable = !aEnabled;
         log("Original 'bluetooth.enabled' is " + origEnabled);
 
--- a/dom/bluetooth/tests/marionette/test_dom_BluetoothManager_enabled.js
+++ b/dom/bluetooth/tests/marionette/test_dom_BluetoothManager_enabled.js
@@ -53,17 +53,17 @@ function test(aEnabled) {
       } else {
         deferred.reject();
       }
     });
 
   return deferred.promise;
 }
 
-startBluetoothTestBase(["settings-read", "settings-write"],
+startBluetoothTestBase(["settings-read", "settings-write", "settings-api-read", "settings-api-write"],
                        function testCaseMain() {
   return getBluetoothEnabled()
     .then(function(aEnabled) {
       log("Original 'bluetooth.enabled' is " + aEnabled);
       // Set to !aEnabled and reset back to aEnabled.
       return test(!aEnabled).then(test.bind(null, aEnabled));
     });
 });
--- a/dom/bluetooth2/tests/marionette/test_dom_BluetoothManager_API2.js
+++ b/dom/bluetooth2/tests/marionette/test_dom_BluetoothManager_API2.js
@@ -34,15 +34,15 @@ function waitForManagerAttributeChanged(
       ok(true, "BluetoothManager event 'onattributechanged' got.");
       deferred.resolve(aEvent);
     }
   };
 
   return deferred.promise;
 }
 
-startBluetoothTestBase(["settings-read", "settings-write"],
+startBluetoothTestBase(["settings-read", "settings-write", "settings-api-read", "settings-api-write"],
                        function testCaseMain() {
   let adapters = bluetoothManager.getAdapters();
   ok(Array.isArray(adapters), "Can not got the array of adapters");
   ok(adapters.length, "The number of adapters should not be zero");
   ok(bluetoothManager.defaultAdapter, "defaultAdapter should not be null.");
 });
--- a/dom/fmradio/test/marionette/test_bug876597.js
+++ b/dom/fmradio/test/marionette/test_bug876597.js
@@ -1,16 +1,18 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
 MARIONETTE_TIMEOUT = 10000;
 
 SpecialPowers.addPermission("fmradio", true, document);
 SpecialPowers.addPermission("settings-read", true, document);
 SpecialPowers.addPermission("settings-write", true, document);
+SpecialPowers.addPermission("settings-api-read", true, document);
+SpecialPowers.addPermission("settings-api-write", true, document);
 
 let FMRadio = window.navigator.mozFMRadio;
 let mozSettings = window.navigator.mozSettings;
 let KEY = "airplaneMode.enabled";
 
 function verifyInitialState() {
   log("Verifying initial state.");
   ok(FMRadio);
--- a/dom/mobileconnection/tests/marionette/test_dsds_mobile_data_connection.js
+++ b/dom/mobileconnection/tests/marionette/test_dsds_mobile_data_connection.js
@@ -146,9 +146,9 @@ startDSDSTestCommon(function() {
   numOfRadioInterfaces = getNumOfRadioInterfaces();
 
   return testEnableData()
     .then(testSwitchDefaultDataToSimTwo)
     .then(testDisableDataRoamingWhileRoaming)
     .then(testEnableDataRoamingWhileRoaming)
     .then(testDisableData)
     .then(restoreTestEnvironment);
-}, ["settings-read", "settings-write"]);
+}, ["settings-read", "settings-write", "settings-api-read", "settings-api-write"]);
--- a/dom/mobileconnection/tests/marionette/test_mobile_data_connection.js
+++ b/dom/mobileconnection/tests/marionette/test_mobile_data_connection.js
@@ -103,9 +103,9 @@ startTestCommon(function() {
     .then(() => {
       if (origApnSettings) {
         return setDataApnSettings(origApnSettings);
       }
     })
     .then(() => setEmulatorRoamingAndWait(false))
     .then(() => setDataRoamingEnabled(false));
 
-}, ["settings-read", "settings-write"]);
\ No newline at end of file
+}, ["settings-read", "settings-write", "settings-api-read", "settings-api-write"]);
\ No newline at end of file
--- a/dom/mobileconnection/tests/marionette/test_mobile_data_ipv6.js
+++ b/dom/mobileconnection/tests/marionette/test_mobile_data_ipv6.js
@@ -120,9 +120,9 @@ startTestCommon(function() {
     })
 
     .then(() => setDataRoamingEnabled(false))
     .then(function() {
       if (origApnSettings) {
         return setDataApnSettings(origApnSettings);
       }
     });
-}, ["settings-read", "settings-write"]);
+}, ["settings-read", "settings-write", "settings-api-read", "settings-api-write"]);
--- a/dom/mobileconnection/tests/marionette/test_mobile_set_radio.js
+++ b/dom/mobileconnection/tests/marionette/test_mobile_set_radio.js
@@ -33,9 +33,9 @@ startTestCommon(function() {
       is(mobileConnection.data.connected, false);
     })
 
     // Restore test environment.
     .then(() => setDataApnSettings(origApnSettings))
     .then(() => setDataEnabled(false))
     .then(() => setRadioEnabledAndWait(true));
 
-}, ["settings-read", "settings-write"]);
+}, ["settings-read", "settings-write", "settings-api-read", "settings-api-write"]);
--- a/dom/tethering/tests/marionette/head.js
+++ b/dom/tethering/tests/marionette/head.js
@@ -533,16 +533,18 @@ let gTestSuite = (function() {
    * @return A deferred promise.
    */
   function acquirePermission() {
     let deferred = Promise.defer();
 
     let permissions = [{ 'type': 'wifi-manage', 'allow': 1, 'context': window.document },
                        { 'type': 'settings-write', 'allow': 1, 'context': window.document },
                        { 'type': 'settings-read', 'allow': 1, 'context': window.document },
+                       { 'type': 'settings-api-write', 'allow': 1, 'context': window.document },
+                       { 'type': 'settings-api-read', 'allow': 1, 'context': window.document },
                        { 'type': 'mobileconnection', 'allow': 1, 'context': window.document }];
 
     SpecialPowers.pushPermissions(permissions, function() {
       deferred.resolve();
     });
 
     return deferred.promise;
   }
--- a/dom/wifi/test/marionette/head.js
+++ b/dom/wifi/test/marionette/head.js
@@ -204,16 +204,18 @@ let gTestSuite = (function() {
    * @return A deferred promise.
    */
   function addRequiredPermissions() {
     let deferred = Promise.defer();
 
     let permissions = [{ 'type': 'wifi-manage', 'allow': 1, 'context': window.document },
                        { 'type': 'settings-write', 'allow': 1, 'context': window.document },
                        { 'type': 'settings-read', 'allow': 1, 'context': window.document },
+                       { 'type': 'settings-api-write', 'allow': 1, 'context': window.document },
+                       { 'type': 'settings-api-read', 'allow': 1, 'context': window.document },
                        { 'type': 'mobileconnection', 'allow': 1, 'context': window.document }];
 
     SpecialPowers.pushPermissions(permissions, function() {
       deferred.resolve();
     });
 
     return deferred.promise;
   }