From 61adc43df37a644db5193c035e0db72d852582eb Mon Sep 17 00:00:00 2001 From: Kyle Machulis Date: Wed, 27 Aug 2014 21:01:29 -0700 Subject: [PATCH] Bug 846200 - Update mochitests to use new settings-api permissions; r=bent --HG-- extra : rebase_source : edf9accf26a49a541c2f87847c2fe89c42a20fd6 --- dom/permission/tests/unit/test_bug808734.js | 1 + dom/settings/tests/test_settings_basics.html | 2 ++ dom/settings/tests/test_settings_blobs.html | 2 ++ dom/settings/tests/test_settings_data_uris.html | 2 ++ dom/settings/tests/test_settings_navigator_object.html | 4 +++- dom/settings/tests/test_settings_onsettingchange.html | 2 ++ dom/tests/mochitest/geolocation/test_mozsettings.html | 6 +++++- dom/tests/mochitest/geolocation/test_mozsettingsWatch.html | 6 +++++- 8 files changed, 22 insertions(+), 3 deletions(-) diff --git a/dom/permission/tests/unit/test_bug808734.js b/dom/permission/tests/unit/test_bug808734.js index 231b2d9ed74..fc0a131872a 100644 --- a/dom/permission/tests/unit/test_bug808734.js +++ b/dom/permission/tests/unit/test_bug808734.js @@ -15,6 +15,7 @@ var gData = [ permission: "settings", access: READWRITE, expected: ["settings-read", "settings-write", + "settings-api-read", "settings-api-write", "indexedDB-chrome-settings-read", "indexedDB-chrome-settings-write"] }, diff --git a/dom/settings/tests/test_settings_basics.html b/dom/settings/tests/test_settings_basics.html index 0c51fb4fd91..a93f0650ed6 100644 --- a/dom/settings/tests/test_settings_basics.html +++ b/dom/settings/tests/test_settings_basics.html @@ -25,6 +25,8 @@ if (SpecialPowers.isMainProcess()) { SpecialPowers.Cu.import("resource://gre/modules/SettingsChangeNotifier.jsm"); } +SpecialPowers.addPermission("settings-api-read", true, document); +SpecialPowers.addPermission("settings-api-write", true, document); SpecialPowers.addPermission("settings-read", true, document); SpecialPowers.addPermission("settings-write", true, document); diff --git a/dom/settings/tests/test_settings_blobs.html b/dom/settings/tests/test_settings_blobs.html index fa5c0cea76c..2b136ecfc4f 100644 --- a/dom/settings/tests/test_settings_blobs.html +++ b/dom/settings/tests/test_settings_blobs.html @@ -27,6 +27,8 @@ if (SpecialPowers.isMainProcess()) { 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); function onUnwantedSuccess() { ok(false, "onUnwantedSuccess: shouldn't get here"); diff --git a/dom/settings/tests/test_settings_data_uris.html b/dom/settings/tests/test_settings_data_uris.html index b6436a73747..701005824c4 100644 --- a/dom/settings/tests/test_settings_data_uris.html +++ b/dom/settings/tests/test_settings_data_uris.html @@ -27,6 +27,8 @@ if (SpecialPowers.isMainProcess()) { 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); function onUnwantedSuccess() { ok(false, "onUnwantedSuccess: shouldn't get here"); diff --git a/dom/settings/tests/test_settings_navigator_object.html b/dom/settings/tests/test_settings_navigator_object.html index c5d5225cd25..922cf579652 100644 --- a/dom/settings/tests/test_settings_navigator_object.html +++ b/dom/settings/tests/test_settings_navigator_object.html @@ -32,7 +32,9 @@ function testPref() { SpecialPowers.pushPermissions([ {type: "settings-read", allow: 0, context: document}, - {type: "settings-write", allow: 0, context: document} + {type: "settings-write", allow: 0, context: document}, + {type: "settings-api-read", allow: 0, context: document}, + {type: "settings-api-write", allow: 0, context: document} ], function() { ise(frames[0].navigator.mozSettings, null, "navigator.mozSettings is null when the page doesn't have permissions"); testPref(); diff --git a/dom/settings/tests/test_settings_onsettingchange.html b/dom/settings/tests/test_settings_onsettingchange.html index d24bdefcc96..03232cf9b76 100644 --- a/dom/settings/tests/test_settings_onsettingchange.html +++ b/dom/settings/tests/test_settings_onsettingchange.html @@ -27,6 +27,8 @@ if (SpecialPowers.isMainProcess()) { SpecialPowers.addPermission("settings-write", true, document); SpecialPowers.addPermission("settings-read", true, document); +SpecialPowers.addPermission("settings-api-read", true, document); +SpecialPowers.addPermission("settings-api-write", true, document); var screenBright = {"screen.brightness": 0.7}; diff --git a/dom/tests/mochitest/geolocation/test_mozsettings.html b/dom/tests/mochitest/geolocation/test_mozsettings.html index 6e3dcfeaf7b..71ee15e56a2 100644 --- a/dom/tests/mochitest/geolocation/test_mozsettings.html +++ b/dom/tests/mochitest/geolocation/test_mozsettings.html @@ -31,7 +31,11 @@ if (SpecialPowers.isMainProcess()) { function test1() { //This pushPermissions call is after pushPrefEnv call and pushPrefEnv calls follow after this - SpecialPowers.pushPermissions([{'type': 'settings-read', 'allow': true, 'context': document}, {'type': 'settings-write', 'allow': true, 'context': document}], test2); + SpecialPowers.pushPermissions([{'type': 'settings-read', 'allow': true, 'context': document}, + {'type': 'settings-write', 'allow': true, 'context': document}, + {'type': 'settings-api-write', 'allow': true, 'context': document}, + {'type': 'settings-api-read', 'allow': true, 'context': document} + ], test2); } function test2() { diff --git a/dom/tests/mochitest/geolocation/test_mozsettingsWatch.html b/dom/tests/mochitest/geolocation/test_mozsettingsWatch.html index a99cd07e8cd..52544fac981 100644 --- a/dom/tests/mochitest/geolocation/test_mozsettingsWatch.html +++ b/dom/tests/mochitest/geolocation/test_mozsettingsWatch.html @@ -31,7 +31,11 @@ if (SpecialPowers.isMainProcess()) { function test1() { //This pushPermissions call is after pushPrefEnv call and pushPrefEnv calls follow after this - SpecialPowers.pushPermissions([{'type': 'settings-read', 'allow': true, 'context': document}, {'type': 'settings-write', 'allow': true, 'context': document}], test2); + SpecialPowers.pushPermissions([{'type': 'settings-read', 'allow': true, 'context': document}, + {'type': 'settings-write', 'allow': true, 'context': document}, + {'type': 'settings-api-write', 'allow': true, 'context': document}, + {'type': 'settings-api-read', 'allow': true, 'context': document} + ], test2); } var watchId;