зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1622012 - [marionette] Read the "marionette.enabled" pref only during startup, and don't allow to change its value. r=marionette-reviewers,maja_zf
Differential Revision: https://phabricator.services.mozilla.com/D67035 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
5d1f573707
Коммит
4c3d158d50
|
@ -306,22 +306,11 @@ class MarionetteParentProcess {
|
|||
this.alteredPrefs = new Set();
|
||||
|
||||
if (env.exists(ENV_ENABLED)) {
|
||||
MarionettePrefs.enabled = true;
|
||||
this.enabled = true;
|
||||
} else {
|
||||
this.enabled = MarionettePrefs.enabled;
|
||||
}
|
||||
|
||||
XPCOMUtils.defineLazyPreferenceGetter(
|
||||
this,
|
||||
"enabled",
|
||||
"marionette.enabled",
|
||||
false,
|
||||
(aPreference, previousValue, newValue) => {
|
||||
if (newValue) {
|
||||
this.init(false);
|
||||
} else {
|
||||
this.uninit();
|
||||
}
|
||||
}
|
||||
);
|
||||
Services.ppmm.addMessageListener("Marionette:IsRunning", this);
|
||||
}
|
||||
|
||||
|
@ -362,7 +351,7 @@ class MarionetteParentProcess {
|
|||
Services.obs.removeObserver(this, topic);
|
||||
|
||||
if (!this.enabled && subject.handleFlag("marionette", false)) {
|
||||
MarionettePrefs.enabled = true;
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
// We want to suppress the modal dialog that's shown
|
||||
|
|
|
@ -135,10 +135,6 @@ class MarionetteBranch extends Branch {
|
|||
return this.get("enabled", false);
|
||||
}
|
||||
|
||||
set enabled(isEnabled) {
|
||||
this.set("enabled", isEnabled);
|
||||
}
|
||||
|
||||
/**
|
||||
* The `marionette.debugging.clicktostart` preference delays
|
||||
* server startup until a modal dialogue has been clicked to allow
|
||||
|
|
|
@ -119,14 +119,11 @@ add_test(function test_MarionettePrefs_getters() {
|
|||
|
||||
add_test(function test_MarionettePrefs_setters() {
|
||||
try {
|
||||
MarionettePrefs.enabled = true;
|
||||
MarionettePrefs.contentListener = true;
|
||||
MarionettePrefs.port = 777;
|
||||
equal(true, MarionettePrefs.enabled);
|
||||
equal(true, MarionettePrefs.contentListener);
|
||||
equal(777, MarionettePrefs.port);
|
||||
} finally {
|
||||
Services.prefs.clearUserPref("marionette.enabled");
|
||||
Services.prefs.clearUserPref("marionette.contentListener");
|
||||
Services.prefs.clearUserPref("marionette.port");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче