mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 00:05:36 +00:00
Backed out changeset 737f0e3e2f94 (bug 1660057) for xpcshell perma failures. CLOSED TREE
This commit is contained in:
parent
4f9bc7b6dc
commit
8de1e9f262
@ -9398,8 +9398,10 @@ var ConfirmationHint = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function reportRemoteSubframesEnabledTelemetry() {
|
function reportRemoteSubframesEnabledTelemetry() {
|
||||||
|
let autostart = Services.prefs.getBoolPref("fission.autostart");
|
||||||
|
|
||||||
let categoryLabel = gFissionBrowser ? "Enabled" : "Disabled";
|
let categoryLabel = gFissionBrowser ? "Enabled" : "Disabled";
|
||||||
if (gFissionBrowser == Services.appinfo.fissionAutostart) {
|
if (autostart == gFissionBrowser) {
|
||||||
categoryLabel += "ByAutostart";
|
categoryLabel += "ByAutostart";
|
||||||
} else {
|
} else {
|
||||||
categoryLabel += "ByUser";
|
categoryLabel += "ByUser";
|
||||||
@ -9414,7 +9416,8 @@ if (AppConstants.NIGHTLY_BUILD) {
|
|||||||
var FissionTestingUI = {
|
var FissionTestingUI = {
|
||||||
init() {
|
init() {
|
||||||
// Handle the Fission/Non-Fission testing UI.
|
// Handle the Fission/Non-Fission testing UI.
|
||||||
if (!Services.appinfo.fissionAutostart) {
|
let autostart = Services.prefs.getBoolPref("fission.autostart");
|
||||||
|
if (!autostart) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
add_task(async function() {
|
add_task(async function() {
|
||||||
const isWebRenderEnabled = Services.prefs.getBoolPref("gfx.webrender.all");
|
const isWebRenderEnabled = Services.prefs.getBoolPref("gfx.webrender.all");
|
||||||
const isFissionEnabled = SpecialPowers.useRemoteSubframes;
|
const isFissionEnabled = Services.prefs.getBoolPref("fission.autostart");
|
||||||
if (isFissionEnabled && !isWebRenderEnabled) {
|
if (isFissionEnabled && !isWebRenderEnabled) {
|
||||||
// This configuration is not supported.
|
// This configuration is not supported.
|
||||||
// Also, in this specific configuration, we're displaying a warning, which looks like a flicker.
|
// Also, in this specific configuration, we're displaying a warning, which looks like a flicker.
|
||||||
|
@ -108,7 +108,7 @@ add_task(async () => {
|
|||||||
|
|
||||||
// Navigate to an url that should switch to another target
|
// Navigate to an url that should switch to another target
|
||||||
// when fission is enabled.
|
// when fission is enabled.
|
||||||
if (SpecialPowers.useRemoteSubframes) {
|
if (Services.prefs.getBoolPref("fission.autostart")) {
|
||||||
info("Navigate to another page running on content process");
|
info("Navigate to another page running on content process");
|
||||||
await navigateTo(CONTENT_PROCESS_PAGE2, tab, toolbox, extension);
|
await navigateTo(CONTENT_PROCESS_PAGE2, tab, toolbox, extension);
|
||||||
|
|
||||||
|
@ -52,6 +52,7 @@ const FORBIDDEN_IDS = new Set(["toolbox", ""]);
|
|||||||
const MAX_ORDINAL = 99;
|
const MAX_ORDINAL = 99;
|
||||||
|
|
||||||
const CONTENT_FISSION_ENABLED_PREF = "devtools.contenttoolbox.fission";
|
const CONTENT_FISSION_ENABLED_PREF = "devtools.contenttoolbox.fission";
|
||||||
|
const FISSION_AUTOSTART_PREF = "fission.autostart";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DevTools is a class that represents a set of developer tools, it holds a
|
* DevTools is a class that represents a set of developer tools, it holds a
|
||||||
@ -852,7 +853,10 @@ DevTools.prototype = {
|
|||||||
// Checking fission.autostart is not used to check if the current target
|
// Checking fission.autostart is not used to check if the current target
|
||||||
// is a Fission tab, but only to check if the user is currently dogfooding
|
// is a Fission tab, but only to check if the user is currently dogfooding
|
||||||
// Fission.
|
// Fission.
|
||||||
const isFissionEnabled = Services.appinfo.fissionAutostart;
|
const isFissionEnabled = Services.prefs.getBoolPref(
|
||||||
|
FISSION_AUTOSTART_PREF,
|
||||||
|
false
|
||||||
|
);
|
||||||
this._cachedFissionContentToolboxEnabled =
|
this._cachedFissionContentToolboxEnabled =
|
||||||
isFissionEnabled && isContentFissionEnabled;
|
isFissionEnabled && isContentFissionEnabled;
|
||||||
}
|
}
|
||||||
|
@ -612,7 +612,7 @@ function BuildConditionSandbox(aURL) {
|
|||||||
sandbox.verify = prefs.getBoolPref("reftest.verify", false);
|
sandbox.verify = prefs.getBoolPref("reftest.verify", false);
|
||||||
|
|
||||||
// Running with a variant enabled?
|
// Running with a variant enabled?
|
||||||
sandbox.fission = Services.appinfo.fissionAutostart;
|
sandbox.fission = prefs.getBoolPref("fission.autostart", false);
|
||||||
sandbox.serviceWorkerE10s = prefs.getBoolPref("dom.serviceWorkers.parent_intercept", false);
|
sandbox.serviceWorkerE10s = prefs.getBoolPref("dom.serviceWorkers.parent_intercept", false);
|
||||||
|
|
||||||
if (!g.dumpedConditionSandbox) {
|
if (!g.dumpedConditionSandbox) {
|
||||||
|
@ -162,11 +162,11 @@ function OnRefTestLoad(win)
|
|||||||
var env = Cc["@mozilla.org/process/environment;1"].
|
var env = Cc["@mozilla.org/process/environment;1"].
|
||||||
getService(Ci.nsIEnvironment);
|
getService(Ci.nsIEnvironment);
|
||||||
|
|
||||||
g.browserIsRemote = Services.appinfo.browserTabsRemoteAutostart;
|
|
||||||
g.browserIsFission = Services.appinfo.fissionAutostart;
|
|
||||||
|
|
||||||
var prefs = Cc["@mozilla.org/preferences-service;1"].
|
var prefs = Cc["@mozilla.org/preferences-service;1"].
|
||||||
getService(Ci.nsIPrefBranch);
|
getService(Ci.nsIPrefBranch);
|
||||||
|
g.browserIsRemote = prefs.getBoolPref("browser.tabs.remote.autostart", false);
|
||||||
|
g.browserIsFission = prefs.getBoolPref("fission.autostart", false);
|
||||||
|
|
||||||
g.browserIsIframe = prefs.getBoolPref("reftest.browser.iframe.enabled", false);
|
g.browserIsIframe = prefs.getBoolPref("reftest.browser.iframe.enabled", false);
|
||||||
|
|
||||||
g.logLevel = prefs.getStringPref("reftest.logLevel", "info");
|
g.logLevel = prefs.getStringPref("reftest.logLevel", "info");
|
||||||
|
@ -10,9 +10,6 @@
|
|||||||
# xpconnect tests
|
# xpconnect tests
|
||||||
[include:../../../../../js/xpconnect/tests/marionette/manifest.ini]
|
[include:../../../../../js/xpconnect/tests/marionette/manifest.ini]
|
||||||
|
|
||||||
# xre tests
|
|
||||||
[include:../../../../../toolkit/xre/test/marionette/marionette.ini]
|
|
||||||
|
|
||||||
# searchservice tests
|
# searchservice tests
|
||||||
[include:../../../../../browser/components/search/test/marionette/manifest.ini]
|
[include:../../../../../browser/components/search/test/marionette/manifest.ini]
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@ XPCOMUtils.defineLazyGetter(this, "logger", () => Log.get());
|
|||||||
|
|
||||||
const XHTML_NS = "http://www.w3.org/1999/xhtml";
|
const XHTML_NS = "http://www.w3.org/1999/xhtml";
|
||||||
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
|
||||||
|
const PREF_E10S = "browser.tabs.remote.autostart";
|
||||||
|
const PREF_FISSION = "fission.autostart";
|
||||||
|
|
||||||
const SCREENSHOT_MODE = {
|
const SCREENSHOT_MODE = {
|
||||||
unexpected: 0,
|
unexpected: 0,
|
||||||
@ -73,8 +75,8 @@ reftest.Runner = class {
|
|||||||
this.isPrint = null;
|
this.isPrint = null;
|
||||||
this.windowUtils = null;
|
this.windowUtils = null;
|
||||||
this.lastURL = null;
|
this.lastURL = null;
|
||||||
this.useRemoteTabs = Services.appinfo.browserTabsRemoteAutostart;
|
this.useRemoteTabs = Preferences.get(PREF_E10S);
|
||||||
this.useRemoteSubframes = Services.appinfo.fissionAutostart;
|
this.useRemoteSubframes = Preferences.get(PREF_FISSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -180,7 +180,7 @@ exports.reloadPageAndLog = async function(name, toolbox, onReload) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.isFissionEnabled = function() {
|
exports.isFissionEnabled = function() {
|
||||||
return Services.appinfo.fissionAutostart;
|
return Services.prefs.getBoolPref("fission.autostart", false);
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.waitForTick = () => new Promise(res => setTimeout(res, 0));
|
exports.waitForTick = () => new Promise(res => setTimeout(res, 0));
|
||||||
|
@ -89,8 +89,15 @@ ActorManagerParent.flush();
|
|||||||
|
|
||||||
const { promiseDocumentLoaded, promiseEvent, promiseObserved } = ExtensionUtils;
|
const { promiseDocumentLoaded, promiseEvent, promiseObserved } = ExtensionUtils;
|
||||||
|
|
||||||
var REMOTE_CONTENT_SCRIPTS = Services.appinfo.browserTabsRemoteAutostart;
|
var REMOTE_CONTENT_SCRIPTS = Services.prefs.getBoolPref(
|
||||||
const REMOTE_CONTENT_SUBFRAMES = Services.appinfo.fissionAutostart;
|
"browser.tabs.remote.autostart",
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
|
const REMOTE_CONTENT_SUBFRAMES = Services.prefs.getBoolPref(
|
||||||
|
"fission.autostart",
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
let BASE_MANIFEST = Object.freeze({
|
let BASE_MANIFEST = Object.freeze({
|
||||||
applications: Object.freeze({
|
applications: Object.freeze({
|
||||||
|
@ -172,7 +172,7 @@ const BackgroundPageThumbs = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
get useFissionBrowser() {
|
get useFissionBrowser() {
|
||||||
return Services.appinfo.fissionAutostart;
|
return Services.prefs.getBoolPref("fission.autostart");
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -10,6 +10,7 @@ var classifierTester = {
|
|||||||
FLASHBLOCK_ENABLE_PREF: "plugins.flashBlock.enabled",
|
FLASHBLOCK_ENABLE_PREF: "plugins.flashBlock.enabled",
|
||||||
FLASH_PLUGIN_USER_SETTING_PREF: "plugin.state.flash",
|
FLASH_PLUGIN_USER_SETTING_PREF: "plugin.state.flash",
|
||||||
URLCLASSIFIER_DISALLOW_COMPLETIONS_PREF: "urlclassifier.disallow_completions",
|
URLCLASSIFIER_DISALLOW_COMPLETIONS_PREF: "urlclassifier.disallow_completions",
|
||||||
|
FISSION_PREF: "fission.autostart",
|
||||||
NEVER_ACTIVATE_PREF_VALUE: 0,
|
NEVER_ACTIVATE_PREF_VALUE: 0,
|
||||||
ASK_TO_ACTIVATE_PREF_VALUE: 1,
|
ASK_TO_ACTIVATE_PREF_VALUE: 1,
|
||||||
ALWAYS_ACTIVATE_PREF_VALUE: 2,
|
ALWAYS_ACTIVATE_PREF_VALUE: 2,
|
||||||
@ -384,7 +385,7 @@ var classifierTester = {
|
|||||||
checkPluginInfo(pluginInfo, expectedClassification, flashSetting) {
|
checkPluginInfo(pluginInfo, expectedClassification, flashSetting) {
|
||||||
// Flashblocking is disabled when fission is enabled, so all the classifications
|
// Flashblocking is disabled when fission is enabled, so all the classifications
|
||||||
// should be "unknown"
|
// should be "unknown"
|
||||||
if (Services.appinfo.fissionAutostart) {
|
if (Services.prefs.getBoolPref(classifierTester.FISSION_PREF)) {
|
||||||
expectedClassification = "unknown";
|
expectedClassification = "unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ function canDisableFlashProtectedMode(aPlugin) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function canDisableFlashBlocking() {
|
function canDisableFlashBlocking() {
|
||||||
return Services.appinfo.fissionAutostart;
|
return Services.prefs.getBoolPref("fission.autostart");
|
||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
@ -15,7 +15,6 @@ if CONFIG['OS_ARCH'] == 'WINNT':
|
|||||||
MOCHITEST_MANIFESTS += ['test/mochitest.ini']
|
MOCHITEST_MANIFESTS += ['test/mochitest.ini']
|
||||||
BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
|
BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
|
||||||
XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell.ini']
|
XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell.ini']
|
||||||
MARIONETTE_UNIT_MANIFESTS += ['test/marionette/marionette.ini']
|
|
||||||
|
|
||||||
XPIDL_SOURCES += [
|
XPIDL_SOURCES += [
|
||||||
'nsINativeAppSupport.idl',
|
'nsINativeAppSupport.idl',
|
||||||
|
@ -456,86 +456,6 @@ static ArgResult CheckArgExists(const char* aArg) {
|
|||||||
bool gSafeMode = false;
|
bool gSafeMode = false;
|
||||||
bool gFxREmbedded = false;
|
bool gFxREmbedded = false;
|
||||||
|
|
||||||
// Fission enablement for the current session is determined once, at startup,
|
|
||||||
// and then remains the same for the duration of the session.
|
|
||||||
//
|
|
||||||
// The following factors determine whether or not Fission is enabled for a
|
|
||||||
// session, in order of precedence:
|
|
||||||
//
|
|
||||||
// - Safe mode: In safe mode, Fission is never enabled.
|
|
||||||
//
|
|
||||||
// - The MOZ_FORCE_ENABLE_FISSION environment variable: If set to any value,
|
|
||||||
// Fission will be enabled.
|
|
||||||
//
|
|
||||||
// - The following preferences:
|
|
||||||
//
|
|
||||||
// The current enrollment status as controlled by Normandy. This value is only
|
|
||||||
// stored in the default preference branch, and is not persisted across
|
|
||||||
// sessions by the preference service. It therefore isn't available early
|
|
||||||
// enough at startup, and needs to be synced to a preference in the user
|
|
||||||
// branch which is persisted across sessions.
|
|
||||||
static const char kPrefFissionExperimentEnrollmentStatus[] =
|
|
||||||
"fission.experiment.enrollmentStatus";
|
|
||||||
//
|
|
||||||
// The enrollment status to be used at browser startup. This automatically
|
|
||||||
// synced from the above enrollmentStatus preference whenever the latter is
|
|
||||||
// changed. It can have any of the values defined in the
|
|
||||||
// `nsIXULRuntime_ExperimentStatus` enum. Meanings are documented in
|
|
||||||
// the declaration of `nsIXULRuntime.fissionExperimentStatus`
|
|
||||||
static const char kPrefFissionExperimentStartupEnrollmentStatus[] =
|
|
||||||
"fission.experiment.startupEnrollmentStatus";
|
|
||||||
//
|
|
||||||
// The "fission.autostart" preference: If none of the above conditions apply,
|
|
||||||
// and the experiment enrollment status is unknown, then the value of the
|
|
||||||
// "fisison.autostart" preference is used.
|
|
||||||
|
|
||||||
static nsIXULRuntime::ExperimentStatus FissionExperimentStatus() {
|
|
||||||
static nsIXULRuntime::ExperimentStatus sExperimentStatus = ([]() {
|
|
||||||
uint32_t value =
|
|
||||||
Preferences::GetUint(kPrefFissionExperimentStartupEnrollmentStatus);
|
|
||||||
if (value >
|
|
||||||
uint32_t(nsIXULRuntime::ExperimentStatus::eExperimentStatusMax)) {
|
|
||||||
return nsIXULRuntime::ExperimentStatus::eUnknown;
|
|
||||||
}
|
|
||||||
return nsIXULRuntime::ExperimentStatus(value);
|
|
||||||
})();
|
|
||||||
|
|
||||||
return sExperimentStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void OnFissionEnrollmentStatusChanged(const char* aPref, void* aData) {
|
|
||||||
Preferences::SetUint(
|
|
||||||
kPrefFissionExperimentStartupEnrollmentStatus,
|
|
||||||
Preferences::GetUint(kPrefFissionExperimentEnrollmentStatus));
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace mozilla {
|
|
||||||
|
|
||||||
bool FissionAutostart() {
|
|
||||||
static bool sFissionAutostart = ([]() {
|
|
||||||
if (gSafeMode) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (EnvHasValue("MOZ_FORCE_ENABLE_FISSION")) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (FissionExperimentStatus()) {
|
|
||||||
case nsIXULRuntime::ExperimentStatus::eEnrolledControl:
|
|
||||||
return false;
|
|
||||||
case nsIXULRuntime::ExperimentStatus::eEnrolledTreatment:
|
|
||||||
return true;
|
|
||||||
default:
|
|
||||||
return StaticPrefs::fission_autostart_AtStartup_DoNotUseDirectly();
|
|
||||||
}
|
|
||||||
})();
|
|
||||||
|
|
||||||
return sFissionAutostart;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace mozilla
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The nsXULAppInfo object implements nsIFactory so that it can be its own
|
* The nsXULAppInfo object implements nsIFactory so that it can be its own
|
||||||
* singleton.
|
* singleton.
|
||||||
@ -855,18 +775,6 @@ nsXULAppInfo::Observe(nsISupports* aSubject, const char* aTopic,
|
|||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsXULAppInfo::GetFissionAutostart(bool* aResult) {
|
|
||||||
*aResult = FissionAutostart();
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsXULAppInfo::GetFissionExperimentStatus(ExperimentStatus* aResult) {
|
|
||||||
*aResult = FissionExperimentStatus();
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsXULAppInfo::GetBrowserTabsRemoteAutostart(bool* aResult) {
|
nsXULAppInfo::GetBrowserTabsRemoteAutostart(bool* aResult) {
|
||||||
*aResult = BrowserTabsRemoteAutostart();
|
*aResult = BrowserTabsRemoteAutostart();
|
||||||
@ -4770,9 +4678,6 @@ nsresult XREMain::XRE_mainRun() {
|
|||||||
# endif // defined(MOZ_DEFAULT_BROWSER_AGENT)
|
# endif // defined(MOZ_DEFAULT_BROWSER_AGENT)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Preferences::RegisterCallback(&OnFissionEnrollmentStatusChanged,
|
|
||||||
kPrefFissionExperimentEnrollmentStatus);
|
|
||||||
|
|
||||||
#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_WIDGET_GTK)
|
#if defined(HAVE_DESKTOP_STARTUP_ID) && defined(MOZ_WIDGET_GTK)
|
||||||
// Clear the environment variable so it won't be inherited by
|
// Clear the environment variable so it won't be inherited by
|
||||||
// child processes and confuse things.
|
// child processes and confuse things.
|
||||||
@ -5296,6 +5201,12 @@ bool BrowserTabsRemoteAutostart() {
|
|||||||
return gBrowserTabsRemoteAutostart;
|
return gBrowserTabsRemoteAutostart;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FissionAutostart() {
|
||||||
|
return !gSafeMode &&
|
||||||
|
(StaticPrefs::fission_autostart_AtStartup_DoNotUseDirectly() ||
|
||||||
|
EnvHasValue("MOZ_FORCE_ENABLE_FISSION"));
|
||||||
|
}
|
||||||
|
|
||||||
uint32_t GetMaxWebProcessCount() {
|
uint32_t GetMaxWebProcessCount() {
|
||||||
// multiOptOut is in int to allow us to run multiple experiments without
|
// multiOptOut is in int to allow us to run multiple experiments without
|
||||||
// introducing multiple prefs a la the autostart.N prefs.
|
// introducing multiple prefs a la the autostart.N prefs.
|
||||||
|
@ -1 +0,0 @@
|
|||||||
[test_fission_autostart.py]
|
|
@ -1,175 +0,0 @@
|
|||||||
from __future__ import absolute_import, print_function
|
|
||||||
|
|
||||||
from marionette_harness import MarionetteTestCase
|
|
||||||
|
|
||||||
|
|
||||||
class ExperimentStatus:
|
|
||||||
UNKNOWN = 0
|
|
||||||
ENROLLED_CONTROL = 1
|
|
||||||
ENROLLED_TREATMENT = 2
|
|
||||||
|
|
||||||
|
|
||||||
class Prefs:
|
|
||||||
ENROLLMENT_STATUS = 'fission.experiment.enrollmentStatus'
|
|
||||||
STARTUP_ENROLLMENT_STATUS = 'fission.experiment.startupEnrollmentStatus'
|
|
||||||
FISSION_AUTOSTART = 'fission.autostart'
|
|
||||||
|
|
||||||
|
|
||||||
ENV_ENABLE_FISSION = 'MOZ_FORCE_ENABLE_FISSION'
|
|
||||||
|
|
||||||
|
|
||||||
class TestFissionAutostart(MarionetteTestCase):
|
|
||||||
SANDBOX_NAME = 'fission-autostart'
|
|
||||||
|
|
||||||
def execute_script(self, code, *args, **kwargs):
|
|
||||||
with self.marionette.using_context(self.marionette.CONTEXT_CHROME):
|
|
||||||
return self.marionette.execute_script(code,
|
|
||||||
new_sandbox=False,
|
|
||||||
sandbox=self.SANDBOX_NAME,
|
|
||||||
*args, **kwargs)
|
|
||||||
|
|
||||||
def get_fission_status(self):
|
|
||||||
return self.execute_script(r'''
|
|
||||||
let win = Services.wm.getMostRecentWindow("navigator:browser");
|
|
||||||
return {
|
|
||||||
fissionAutostart: Services.appinfo.fissionAutostart,
|
|
||||||
fissionExperimentStatus: Services.appinfo.fissionExperimentStatus,
|
|
||||||
useRemoteSubframes: win.docShell.nsILoadContext.useRemoteSubframes,
|
|
||||||
};
|
|
||||||
''')
|
|
||||||
|
|
||||||
def check_fission_status(self, enabled, experiment):
|
|
||||||
expected = {
|
|
||||||
'fissionAutostart': enabled,
|
|
||||||
'fissionExperimentStatus': experiment,
|
|
||||||
'useRemoteSubframes': enabled,
|
|
||||||
}
|
|
||||||
|
|
||||||
status = self.get_fission_status()
|
|
||||||
|
|
||||||
for prop, value in expected.items():
|
|
||||||
self.assertEqual(
|
|
||||||
status[prop], value,
|
|
||||||
'%s should have the value `%r`, but has `%r`'
|
|
||||||
% (prop, value, status[prop]))
|
|
||||||
|
|
||||||
def set_env(self, env, value):
|
|
||||||
self.execute_script('env.set(arguments[0], arguments[1]);',
|
|
||||||
script_args=(env, value))
|
|
||||||
|
|
||||||
def get_env(self, env):
|
|
||||||
return self.execute_script('return env.get(arguments[0]);',
|
|
||||||
script_args=(env,))
|
|
||||||
|
|
||||||
def set_enrollment_status(self, status):
|
|
||||||
self.marionette.set_pref(Prefs.ENROLLMENT_STATUS,
|
|
||||||
status,
|
|
||||||
default_branch=True)
|
|
||||||
|
|
||||||
startup_status = self.marionette.get_pref(
|
|
||||||
Prefs.STARTUP_ENROLLMENT_STATUS)
|
|
||||||
self.assertEqual(startup_status, status,
|
|
||||||
'Startup enrollment status (%r) should match new '
|
|
||||||
'session status (%r)' % (startup_status, status))
|
|
||||||
|
|
||||||
def restart(self, prefs=None, env=None):
|
|
||||||
if prefs:
|
|
||||||
self.marionette.set_prefs(prefs)
|
|
||||||
|
|
||||||
if env:
|
|
||||||
for name, value in env.items():
|
|
||||||
self.set_env(name, value)
|
|
||||||
|
|
||||||
self.marionette.restart(in_app=True, clean=False)
|
|
||||||
self.setUpSession()
|
|
||||||
|
|
||||||
# Sanity check our environment.
|
|
||||||
if prefs:
|
|
||||||
for key, val in prefs.items():
|
|
||||||
self.assertEqual(self.marionette.get_pref(key), val)
|
|
||||||
if env:
|
|
||||||
for key, val in env.items():
|
|
||||||
self.assertEqual(self.get_env(key), val or '')
|
|
||||||
|
|
||||||
def setUpSession(self):
|
|
||||||
self.marionette.set_context(self.marionette.CONTEXT_CHROME)
|
|
||||||
|
|
||||||
self.execute_script(r'''
|
|
||||||
// We're running in a function, in a sandbox, that inherits from an
|
|
||||||
// X-ray wrapped window. Anything we want to be globally available
|
|
||||||
// needs to be defined on that window.
|
|
||||||
ChromeUtils.import("resource://gre/modules/Services.jsm", window);
|
|
||||||
window.env = Cc["@mozilla.org/process/environment;1"]
|
|
||||||
.getService(Ci.nsIEnvironment);
|
|
||||||
''')
|
|
||||||
|
|
||||||
def setUp(self):
|
|
||||||
super(TestFissionAutostart, self).setUp()
|
|
||||||
|
|
||||||
self.setUpSession()
|
|
||||||
|
|
||||||
def tearDown(self):
|
|
||||||
self.marionette.restart(clean=True)
|
|
||||||
|
|
||||||
super(TestFissionAutostart, self).tearDown()
|
|
||||||
|
|
||||||
def test_runtime_changes(self):
|
|
||||||
"""Tests that changes to preferences during runtime do not have any
|
|
||||||
effect on the current session."""
|
|
||||||
|
|
||||||
self.restart(prefs={Prefs.FISSION_AUTOSTART: True})
|
|
||||||
|
|
||||||
self.check_fission_status(enabled=True,
|
|
||||||
experiment=ExperimentStatus.UNKNOWN)
|
|
||||||
|
|
||||||
self.set_enrollment_status(ExperimentStatus.ENROLLED_CONTROL)
|
|
||||||
self.check_fission_status(enabled=True,
|
|
||||||
experiment=ExperimentStatus.UNKNOWN)
|
|
||||||
|
|
||||||
self.marionette.set_pref(Prefs.FISSION_AUTOSTART,
|
|
||||||
False)
|
|
||||||
self.check_fission_status(enabled=True,
|
|
||||||
experiment=ExperimentStatus.UNKNOWN)
|
|
||||||
|
|
||||||
self.restart()
|
|
||||||
self.check_fission_status(enabled=False,
|
|
||||||
experiment=ExperimentStatus.ENROLLED_CONTROL)
|
|
||||||
|
|
||||||
self.marionette.set_pref(Prefs.ENROLLMENT_STATUS,
|
|
||||||
ExperimentStatus.UNKNOWN,
|
|
||||||
default_branch=True)
|
|
||||||
self.check_fission_status(enabled=False,
|
|
||||||
experiment=ExperimentStatus.ENROLLED_CONTROL)
|
|
||||||
|
|
||||||
self.set_env(ENV_ENABLE_FISSION, '1')
|
|
||||||
self.check_fission_status(enabled=False,
|
|
||||||
experiment=ExperimentStatus.ENROLLED_CONTROL)
|
|
||||||
|
|
||||||
def test_fission_precedence(self):
|
|
||||||
self.restart(prefs={Prefs.FISSION_AUTOSTART: False},
|
|
||||||
env={ENV_ENABLE_FISSION: '1'})
|
|
||||||
self.check_fission_status(enabled=True,
|
|
||||||
experiment=ExperimentStatus.UNKNOWN)
|
|
||||||
|
|
||||||
self.restart(prefs={Prefs.FISSION_AUTOSTART: True},
|
|
||||||
env={ENV_ENABLE_FISSION: ''})
|
|
||||||
self.check_fission_status(enabled=True,
|
|
||||||
experiment=ExperimentStatus.UNKNOWN)
|
|
||||||
|
|
||||||
self.restart(prefs={Prefs.FISSION_AUTOSTART: False})
|
|
||||||
self.check_fission_status(enabled=False,
|
|
||||||
experiment=ExperimentStatus.UNKNOWN)
|
|
||||||
|
|
||||||
self.set_enrollment_status(ExperimentStatus.ENROLLED_TREATMENT)
|
|
||||||
self.restart()
|
|
||||||
self.check_fission_status(enabled=True,
|
|
||||||
experiment=ExperimentStatus.ENROLLED_TREATMENT)
|
|
||||||
|
|
||||||
self.set_enrollment_status(ExperimentStatus.ENROLLED_CONTROL)
|
|
||||||
self.restart()
|
|
||||||
self.check_fission_status(enabled=False,
|
|
||||||
experiment=ExperimentStatus.ENROLLED_CONTROL)
|
|
||||||
|
|
||||||
self.restart(prefs={Prefs.FISSION_AUTOSTART: True})
|
|
||||||
self.check_fission_status(enabled=False,
|
|
||||||
experiment=ExperimentStatus.ENROLLED_CONTROL)
|
|
@ -11,7 +11,7 @@ const MAC = AppConstants.platform == "macosx";
|
|||||||
const HAS_THREAD_NAMES =
|
const HAS_THREAD_NAMES =
|
||||||
AppConstants.platform != "win" ||
|
AppConstants.platform != "win" ||
|
||||||
AppConstants.isPlatformAndVersionAtLeast("win", 10);
|
AppConstants.isPlatformAndVersionAtLeast("win", 10);
|
||||||
const isFissionEnabled = SpecialPowers.useRemoteSubframes;
|
const isFissionEnabled = Services.prefs.getBoolPref("fission.autostart");
|
||||||
|
|
||||||
const SAMPLE_SIZE = 10;
|
const SAMPLE_SIZE = 10;
|
||||||
|
|
||||||
|
@ -41,47 +41,6 @@ interface nsIXULRuntime : nsISupports
|
|||||||
*/
|
*/
|
||||||
readonly attribute boolean inSafeMode;
|
readonly attribute boolean inSafeMode;
|
||||||
|
|
||||||
/**
|
|
||||||
* The status of a given experiment, as stored in a preference by Normandy.
|
|
||||||
*/
|
|
||||||
cenum ExperimentStatus : 8 {
|
|
||||||
// The experiment status is unknown, and behavior should not be modified.
|
|
||||||
eUnknown = 0,
|
|
||||||
// The user is enrolled in the control group, and should see the default
|
|
||||||
// behavior.
|
|
||||||
eEnrolledControl = 1,
|
|
||||||
// The user is enrolled in the treatment group, and should see the
|
|
||||||
// experimental behavior which is being tested.
|
|
||||||
eEnrolledTreatment = 2,
|
|
||||||
eExperimentStatusMax = 2,
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Whether Fission should be automatically enabled for new browser windows.
|
|
||||||
*
|
|
||||||
* This value is guaranteed to remain constant for the length of a browser
|
|
||||||
* session.
|
|
||||||
*/
|
|
||||||
readonly attribute boolean fissionAutostart;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The user's enrollment status in the Fission rollout experiment. May be
|
|
||||||
* one of:
|
|
||||||
*
|
|
||||||
* - eUnknown: The user's enrollment status is unknown, and the experiment
|
|
||||||
* should be ignored.
|
|
||||||
*
|
|
||||||
* - eEnrolledControl: The user is enrolled in the control group, and Fission
|
|
||||||
* should be disabled.
|
|
||||||
*
|
|
||||||
* - eEnrolledTreatment: The user is enrolled in the treatment group, and
|
|
||||||
* Fission should be enabled.
|
|
||||||
*
|
|
||||||
* This value is guaranteed to remain constant for the length of a browser
|
|
||||||
* session.
|
|
||||||
*/
|
|
||||||
readonly attribute nsIXULRuntime_ExperimentStatus fissionExperimentStatus;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether to write console errors to a log file. If a component
|
* Whether to write console errors to a log file. If a component
|
||||||
* encounters startup errors that might prevent the app from showing
|
* encounters startup errors that might prevent the app from showing
|
||||||
|
Loading…
Reference in New Issue
Block a user