geckodriver: prefs, marionette: remove or move remaining required prefs

When a user provides a profile that wnats to override browser.warnOnQuit,
browser.tabs.warnOnClose, or browser.showQuitWarning, we should
allow users to do stupid things.  We should not prevent the profile's
preferences from being applied.

dom.ipc.cpows.forbid-unsafe-from-browser is being removed because all
targetted Firefoxen are not using any unsafe CPOWs in Marionette code.

marionette.defaultPrefs.enabled is superfluous for as long as the
--marionette flag is being passed to the Firefox binary.

Remaining relevant prefs from prefs::REQUIRED have been merged into
prefs::DEFAULT.

This is a follow-up to the discussion around
https://github.com/mozilla/geckodriver/pull/423.

Source-Repo: https://github.com/mozilla/geckodriver
Source-Revision: 2e0054b90ecf1acbe8b442af54441e3cc746933f

committer: jgraham <james@hoppipolla.co.uk>

--HG--
extra : rebase_source : 0d5230475735d09d5e7220b8d8b7b91308074900
This commit is contained in:
Andreas Tolfsen 2017-04-04 17:42:28 +01:00
parent 6a1acfc103
commit 2f6786e944
2 changed files with 10 additions and 21 deletions

View File

@ -351,8 +351,6 @@ impl MarionetteHandler {
prefs.insert_slice(&extra_prefs[..]);
prefs.insert_slice(&prefs::REQUIRED[..]);
if let Some(ref level) = self.current_log_level {
prefs.insert("marionette.logging", Pref::new(level.to_string()));
};

View File

@ -1,7 +1,7 @@
use mozprofile::preferences::Pref;
lazy_static! {
pub static ref DEFAULT: [(&'static str, Pref); 75] = [
pub static ref DEFAULT: [(&'static str, Pref); 78] = [
// Disable automatic downloading of new releases
("app.update.auto", Pref::new(false)),
@ -65,6 +65,9 @@ lazy_static! {
// Skip check for default browser on startup
("browser.shell.checkDefaultBrowser", Pref::new(false)),
// Do not warn when quitting with multiple tabs
("browser.showQuitWarning", Pref::new(false)),
// Disable Android snippets
("browser.snippets.enabled", Pref::new(false)),
("browser.snippets.syncPromo.enabled", Pref::new(false)),
@ -88,6 +91,9 @@ lazy_static! {
// might get unloaded
("browser.tabs.disableBackgroundZombification", Pref::new(false)),
// Do not warn on exit when multiple tabs are open
("browser.tabs.warnOnClose", Pref::new(false)),
// Do not warn when closing all other open tabs
("browser.tabs.warnOnCloseOtherTabs", Pref::new(false)),
@ -100,6 +106,9 @@ lazy_static! {
// Disable the UI tour
("browser.uitour.enabled", Pref::new(false)),
// Do not warn on quitting Firefox
("browser.warnOnQuit", Pref::new(false)),
// Do not show datareporting policy notifications which can
// interfere with tests
("datareporting.healthreport.about.reportUrl", Pref::new("http://%(server)s/dummy/abouthealthreport/")),
@ -214,22 +223,4 @@ lazy_static! {
// We want to collect telemetry, but we don't want to send in the results
("toolkit.telemetry.server", Pref::new("https://%(server)s/dummy/telemetry/")),
];
pub static ref REQUIRED: [(&'static str, Pref); 5] = [
// Do not warn on quitting Firefox
("browser.warnOnQuit", Pref::new(false)),
// Do not warn on exit when multiple tabs are open
("browser.tabs.warnOnClose", Pref::new(false)),
// Do not warn when quitting with multiple tabs
("browser.showQuitWarning", Pref::new(false)),
// Until bug 1238095 is fixed, we have to disable safe CPOW checks
("dom.ipc.cpows.forbid-unsafe-from-browser", Pref::new(false)),
// TODO(ato): Should not be needed, as Marionette is enabled by
// passing the --marionette flag to the binary
("marionette.defaultPrefs.enabled", Pref::new(true)),
];
}