Bug 1456995 - enable Service Workers' parent-intercept mode on Nightly r=asuth,jgraham

Due to limitations in the test harness, the "serviceworker_e10s" (for mochitest
and xpcshell) and "sw-e10s" (for WPT) values will match mozinfo's "nightly_build"
value, unless overridden by "--setpref dom.serviceWorkers.parent_intercept=..."
provided at the CLI.

Differential Revision: https://phabricator.services.mozilla.com/D43170

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Perry Jiang 2019-10-08 23:47:48 +00:00
Родитель 398ea07602
Коммит 289cec9298
6 изменённых файлов: 55 добавлений и 9 удалений

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

@ -2121,7 +2121,7 @@
# Note, this is not currently safe to use for normal browsing yet.
- name: dom.serviceWorkers.parent_intercept
type: bool
value: false
value: @IS_NIGHTLY_BUILD@
mirror: never
- name: dom.serviceWorkers.testing.enabled

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

@ -2606,8 +2606,17 @@ toolbar#nav-bar {
"e10s": options.e10s,
"fission": self.extraPrefs.get('fission.autostart', False),
"headless": options.headless,
# Until the test harness can understand default pref values,
# (https://bugzilla.mozilla.org/show_bug.cgi?id=1577912) this value
# should by synchronized with the default pref value indicated in
# StaticPrefList.yaml.
#
# Currently for automation, the pref defaults to true in nightly
# builds and false otherwise (but can be overridden with --setpref).
"serviceworker_e10s": self.extraPrefs.get(
'dom.serviceWorkers.parent_intercept', False),
'dom.serviceWorkers.parent_intercept', mozinfo.info['nightly_build']),
"socketprocess_e10s": self.extraPrefs.get(
'network.process.enabled', False),
"verify": options.verify,

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

@ -153,18 +153,35 @@ def env_options():
def run_info_extras(**kwargs):
def get_bool_pref(pref):
def get_bool_pref_if_exists(pref):
for key, value in kwargs.get('extra_prefs', []):
if pref == key:
return value.lower() in ('true', '1')
return False
return None
def get_bool_pref(pref):
pref_value = get_bool_pref_if_exists(pref)
return pref_value if pref_value is not None else False
rv = {"e10s": kwargs["gecko_e10s"],
"wasm": kwargs.get("wasm", True),
"verify": kwargs["verify"],
"headless": kwargs.get("headless", False) or "MOZ_HEADLESS" in os.environ,
"fission": get_bool_pref("fission.autostart"),
"sw-e10s": get_bool_pref("dom.serviceWorkers.parent_intercept")}
"fission": get_bool_pref("fission.autostart")}
# The value of `sw-e10s` defaults to whether the "parent_intercept"
# implementation is enabled for the current build. This value, however,
# can be overridden by explicitly setting the pref with the `--setpref` CLI
# flag, which is checked here. If not supplied, the default value of
# `sw-e10s` will be filled in in `RunInfo`'s constructor.
#
# We can't capture the default value right now because (currently), it
# defaults to the value of `nightly_build`, which isn't known until
# `RunInfo`'s constructor.
sw_e10s_override = get_bool_pref_if_exists("dom.serviceWorkers.parent_intercept")
if sw_e10s_override is not None:
rv["sw-e10s"] = sw_e10s_override
rv.update(run_info_browser_version(kwargs["binary"]))
return rv

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

@ -67,8 +67,7 @@ def env_extras(**kwargs):
def run_info_extras(**kwargs):
package = kwargs["package_name"]
rv = {"e10s": True if package is not None and "geckoview" in package else False,
"headless": False,
"sw-e10s": False}
"headless": False}
rv.update(run_info_browser_version(kwargs["binary"]))
return rv

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

@ -112,6 +112,18 @@ class RunInfo(dict):
if extras is not None:
self.update(extras)
# Until the test harness can understand default pref values,
# (https://bugzilla.mozilla.org/show_bug.cgi?id=1577912) this value
# should by synchronized with the default pref value indicated in
# StaticPrefList.yaml.
#
# Currently for automation, the pref (and `sw-e10s`) defaults to true in
# nightly builds and false otherwise but can be overridden with
# `--setpref`. If overridden, the value would be initialized in
# `run_info_extras` and be supplied in the `extras` parameter.
if "sw-e10s" not in self:
self["sw-e10s"] = self.get("nightly_build", False)
self["headless"] = extras.get("headless", False)
self["webrender"] = enable_webrender

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

@ -1220,8 +1220,17 @@ class XPCShellTests(object):
self.mozInfo = fixedInfo
self.mozInfo['fission'] = prefs.get('fission.autostart', False)
# Until the test harness can understand default pref values,
# (https://bugzilla.mozilla.org/show_bug.cgi?id=1577912) this value
# should by synchronized with the default pref value indicated in
# StaticPrefList.yaml.
#
# Currently for automation, the pref defaults to true in nightly
# builds and false otherwise (but can be overridden with --setpref).
self.mozInfo['serviceworker_e10s'] = prefs.get(
'dom.serviceWorkers.parent_intercept', False)
'dom.serviceWorkers.parent_intercept', self.mozInfo['nightly_build'])
self.mozInfo['verify'] = options.get('verify', False)
self.mozInfo['webrender'] = self.enable_webrender