Bug 1401129 - Restore extensions.shield-recipe-client.api_url in automation tools. r=whimboo

The extensions.shield-recipe-client.api_url preference was
replaced with app.normandy.api_url in bug 1436113.  There are
multiple automation tools in the tree that target out-of-tree
release channels and removing the old preference would break these.

This patch re-adds the old preference with a note of when it was removed.

MozReview-Commit-ID: HhTfRFkRQTC

--HG--
extra : rebase_source : ec726c528b57e197a34e3e094c1c4bfe5d23da55
This commit is contained in:
Andreas Tolfsen 2018-03-08 15:47:09 +00:00
Родитель 3ca71a66e9
Коммит 77efd9020a
4 изменённых файлов: 24 добавлений и 8 удалений

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

@ -1,7 +1,10 @@
use mozprofile::preferences::Pref;
lazy_static! {
pub static ref DEFAULT: [(&'static str, Pref); 79] = [
pub static ref DEFAULT: [(&'static str, Pref); 80] = [
// Make sure Shield doesn't hit the network.
("app.normandy.api_url", Pref::new("")),
// Disable automatic downloading of new releases
("app.update.auto", Pref::new(false)),
@ -145,7 +148,8 @@ lazy_static! {
("extensions.installDistroAddons", Pref::new(false)),
// Make sure Shield doesn't hit the network.
("app.normandy.api_url", Pref::new("")),
// Removed in Firefox 60.
("extensions.shield-recipe-client.api_url", Pref::new("")),
("extensions.showMismatchUI", Pref::new(false)),

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

@ -24,6 +24,9 @@ from . import errors
class GeckoInstance(object):
required_prefs = {
# Make sure Shield doesn't hit the network.
"app.normandy.api_url": "",
# Increase the APZ content response timeout in tests to 1 minute.
# This is to accommodate the fact that test environments tends to be slower
# than production environments (with the b2g emulator being the slowest of them
@ -55,7 +58,8 @@ class GeckoInstance(object):
# Disable intalling any distribution add-ons
"extensions.installDistroAddons": False,
# Make sure Shield doesn't hit the network.
"app.normandy.api_url": "",
# Removed in Firefox 60.
"extensions.shield-recipe-client.api_url": "",
"extensions.showMismatchUI": False,
# Turn off extension updates so they don't bother tests
"extensions.update.enabled": False,

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

@ -54,6 +54,9 @@ const ENV_PRESERVE_PREFS = "MOZ_MARIONETTE_PREF_STATE_ACROSS_RESTARTS";
// are checked before Marionette initialises.
const RECOMMENDED_PREFS = new Map([
// Make sure Shield doesn't hit the network.
["app.normandy.api_url", ""],
// Disable automatic downloading of new releases.
//
// This should also be set in the profile prior to starting Firefox,
@ -197,9 +200,6 @@ const RECOMMENDED_PREFS = new Map([
// Should be set in profile.
["extensions.installDistroAddons", false],
// Make sure Shield doesn't hit the network.
["extensions.shield-recipe-client.api_url", ""],
["extensions.showMismatchUI", false],
// Turn off extension updates so they do not bother tests

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

@ -32,8 +32,16 @@ class TestPreferences(MarionetteTestCase):
required_prefs = geckoinstance.GeckoInstance.required_prefs
for key, value in required_prefs.iteritems():
self.assertEqual(self.marionette.get_pref(key), value,
"Preference {} hasn't been set to {}".format(key, value))
# The extensions.shield-recipe-client.* prefs branch
# is as of Firefox 60 migrated to app.normandy.*.
#
# This is a workaround that can be removed together
# with extensions.shield-recipe-client.api_url.
if key == "extensions.shield-recipe-client.api_url":
self.assertEqual(self.marionette.get_pref("app.normandy.api_url"), value)
else:
self.assertEqual(self.marionette.get_pref(key), value,
"Preference {} hasn't been set to {}".format(key, repr(value)))
@skip_if_mobile("Only runnable with Firefox")
def test_desktop_instance_preferences(self):