Bug 846200 - Update mochitests to use new settings-api permissions; r=bent

This commit is contained in:
Kyle Machulis 2014-08-19 13:43:56 -07:00
Родитель 9ef69caded
Коммит 54d2bd8015
8 изменённых файлов: 22 добавлений и 3 удалений

Просмотреть файл

@ -15,6 +15,7 @@ var gData = [
permission: "settings", permission: "settings",
access: READWRITE, access: READWRITE,
expected: ["settings-read", "settings-write", expected: ["settings-read", "settings-write",
"settings-api-read", "settings-api-write",
"indexedDB-chrome-settings-read", "indexedDB-chrome-settings-read",
"indexedDB-chrome-settings-write"] "indexedDB-chrome-settings-write"]
}, },

Просмотреть файл

@ -25,6 +25,8 @@ if (SpecialPowers.isMainProcess()) {
SpecialPowers.Cu.import("resource://gre/modules/SettingsChangeNotifier.jsm"); 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-read", true, document);
SpecialPowers.addPermission("settings-write", true, document); SpecialPowers.addPermission("settings-write", true, document);

Просмотреть файл

@ -27,6 +27,8 @@ if (SpecialPowers.isMainProcess()) {
SpecialPowers.addPermission("settings-read", true, document); SpecialPowers.addPermission("settings-read", true, document);
SpecialPowers.addPermission("settings-write", true, document); SpecialPowers.addPermission("settings-write", true, document);
SpecialPowers.addPermission("settings-api-read", true, document);
SpecialPowers.addPermission("settings-api-write", true, document);
function onUnwantedSuccess() { function onUnwantedSuccess() {
ok(false, "onUnwantedSuccess: shouldn't get here"); ok(false, "onUnwantedSuccess: shouldn't get here");

Просмотреть файл

@ -27,6 +27,8 @@ if (SpecialPowers.isMainProcess()) {
SpecialPowers.addPermission("settings-read", true, document); SpecialPowers.addPermission("settings-read", true, document);
SpecialPowers.addPermission("settings-write", true, document); SpecialPowers.addPermission("settings-write", true, document);
SpecialPowers.addPermission("settings-api-read", true, document);
SpecialPowers.addPermission("settings-api-write", true, document);
function onUnwantedSuccess() { function onUnwantedSuccess() {
ok(false, "onUnwantedSuccess: shouldn't get here"); ok(false, "onUnwantedSuccess: shouldn't get here");

Просмотреть файл

@ -32,7 +32,9 @@ function testPref() {
SpecialPowers.pushPermissions([ SpecialPowers.pushPermissions([
{type: "settings-read", allow: 0, context: document}, {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() { ], function() {
ise(frames[0].navigator.mozSettings, null, "navigator.mozSettings is null when the page doesn't have permissions"); ise(frames[0].navigator.mozSettings, null, "navigator.mozSettings is null when the page doesn't have permissions");
testPref(); testPref();

Просмотреть файл

@ -27,6 +27,8 @@ if (SpecialPowers.isMainProcess()) {
SpecialPowers.addPermission("settings-write", true, document); SpecialPowers.addPermission("settings-write", true, document);
SpecialPowers.addPermission("settings-read", 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}; var screenBright = {"screen.brightness": 0.7};

Просмотреть файл

@ -31,7 +31,11 @@ if (SpecialPowers.isMainProcess()) {
function test1() { function test1() {
//This pushPermissions call is after pushPrefEnv call and pushPrefEnv calls follow after this //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() { function test2() {

Просмотреть файл

@ -31,7 +31,11 @@ if (SpecialPowers.isMainProcess()) {
function test1() { function test1() {
//This pushPermissions call is after pushPrefEnv call and pushPrefEnv calls follow after this //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; var watchId;