Bug 1086492 - Disable tilt for E10S r=victorporof,jwalker

This commit is contained in:
Michael Ratcliffe 2014-10-30 16:23:01 +00:00
parent 1bf9a1665f
commit e8382d11a5
9 changed files with 104 additions and 26 deletions

View File

@ -25,49 +25,49 @@ function spawnTest() {
yield gcli.load();
let settings = gcli.settings;
let tiltEnabled = settings.get("devtools.tilt.enabled");
let hideIntroEnabled = settings.get("devtools.gcli.hideIntro");
let tabSize = settings.get("devtools.editor.tabsize");
let remoteHost = settings.get("devtools.debugger.remote-host");
let tiltEnabledOrig = prefBranch.getBoolPref("devtools.tilt.enabled");
let hideIntroOrig = prefBranch.getBoolPref("devtools.gcli.hideIntro");
let tabSizeOrig = prefBranch.getIntPref("devtools.editor.tabsize");
let remoteHostOrig = prefBranch.getComplexValue(
"devtools.debugger.remote-host",
Components.interfaces.nsISupportsString).data;
info("originally: devtools.tilt.enabled = " + tiltEnabledOrig);
info("originally: devtools.gcli.hideIntro = " + hideIntroOrig);
info("originally: devtools.editor.tabsize = " + tabSizeOrig);
info("originally: devtools.debugger.remote-host = " + remoteHostOrig);
// Actual tests
is(tiltEnabled.value, tiltEnabledOrig, "tiltEnabled default");
is(hideIntroEnabled.value, hideIntroOrig, "hideIntroEnabled default");
is(tabSize.value, tabSizeOrig, "tabSize default");
is(remoteHost.value, remoteHostOrig, "remoteHost default");
tiltEnabled.setDefault();
hideIntroEnabled.setDefault();
tabSize.setDefault();
remoteHost.setDefault();
let tiltEnabledDefault = tiltEnabled.value;
let hideIntroEnabledDefault = hideIntroEnabled.value;
let tabSizeDefault = tabSize.value;
let remoteHostDefault = remoteHost.value;
tiltEnabled.value = false;
hideIntroEnabled.value = false;
tabSize.value = 42;
remoteHost.value = "example.com"
remoteHost.value = "example.com";
is(tiltEnabled.value, false, "tiltEnabled basic");
is(hideIntroEnabled.value, false, "hideIntroEnabled basic");
is(tabSize.value, 42, "tabSize basic");
is(remoteHost.value, "example.com", "remoteHost basic");
function tiltEnabledCheck(ev) {
is(ev.setting, tiltEnabled, "tiltEnabled event setting");
is(ev.value, true, "tiltEnabled event value");
is(ev.setting.value, true, "tiltEnabled event setting value");
function hideIntroEnabledCheck(ev) {
is(ev.setting, hideIntroEnabled, "hideIntroEnabled event setting");
is(ev.value, true, "hideIntroEnabled event value");
is(ev.setting.value, true, "hideIntroEnabled event setting value");
}
tiltEnabled.onChange.add(tiltEnabledCheck);
tiltEnabled.value = true;
is(tiltEnabled.value, true, "tiltEnabled change");
hideIntroEnabled.onChange.add(hideIntroEnabledCheck);
hideIntroEnabled.value = true;
is(hideIntroEnabled.value, true, "hideIntroEnabled change");
function tabSizeCheck(ev) {
is(ev.setting, tabSize, "tabSize event setting");
@ -87,7 +87,7 @@ function spawnTest() {
remoteHost.value = "y.com";
is(remoteHost.value, "y.com", "remoteHost change");
tiltEnabled.onChange.remove(tiltEnabledCheck);
hideIntroEnabled.onChange.remove(hideIntroEnabledCheck);
tabSize.onChange.remove(tabSizeCheck);
remoteHost.onChange.remove(remoteHostCheck);
@ -98,18 +98,18 @@ function spawnTest() {
}
remoteHost.onChange.add(remoteHostReCheck);
tiltEnabled.setDefault();
hideIntroEnabled.setDefault();
tabSize.setDefault();
remoteHost.setDefault();
remoteHost.onChange.remove(remoteHostReCheck);
is(tiltEnabled.value, tiltEnabledDefault, "tiltEnabled reset");
is(hideIntroEnabled.value, hideIntroEnabledDefault, "hideIntroEnabled reset");
is(tabSize.value, tabSizeDefault, "tabSize reset");
is(remoteHost.value, remoteHostDefault, "remoteHost reset");
// Cleanup
prefBranch.setBoolPref("devtools.tilt.enabled", tiltEnabledOrig);
prefBranch.setBoolPref("devtools.gcli.hideIntro", hideIntroOrig);
prefBranch.setIntPref("devtools.editor.tabsize", tabSizeOrig);
supportsString.data = remoteHostOrig;
prefBranch.setComplexValue("devtools.debugger.remote-host",

View File

@ -345,6 +345,10 @@ TabTarget.prototype = {
return !!this._tab;
},
get isMultiProcess() {
return !this.window;
},
get isThreadPaused() {
return !!this._isThreadPaused;
},

View File

@ -74,9 +74,14 @@ function testPreferenceAndUIStateIsConsistent() {
function testToggleToolboxButtons() {
let checkNodes = [...panelWin.document.querySelectorAll("#enabled-toolbox-buttons-box > checkbox")];
let toolboxButtonNodes = [...doc.querySelectorAll(".command-button")];
let visibleButtons = toolboxButtonNodes.filter(button=>!button.hasAttribute("hidden"));
let toggleableTools = toolbox.toolboxButtons;
// Tilt is disabled in E10S mode so we skip the tilt button if E10S is
// enabled.
if (toolbox.target.isMultiProcess) {
toolboxButtonNodes = [...doc.querySelectorAll(".command-button:not(#command-button-tilt)")];
}
is (checkNodes.length, toggleableTools.length, "All of the buttons are toggleable." );
is (checkNodes.length, toolboxButtonNodes.length, "All of the DOM buttons are toggleable." );
@ -92,9 +97,9 @@ function testToggleToolboxButtons() {
"DOM buttons should match for: " + id);
is (matchedCheckboxes[0].getAttribute("label"), tool.label,
"The label for checkbox matches the tool definition.")
"The label for checkbox matches the tool definition.");
is (matchedButtons[0].getAttribute("tooltiptext"), tool.label,
"The tooltip for button matches the tool definition.")
"The tooltip for button matches the tool definition.");
}
// Store modified pref names so that they can be cleared on error.

View File

@ -182,6 +182,10 @@ OptionsPanel.prototype = {
};
for (let tool of toggleableButtons) {
if (this.toolbox.target.isMultiProcess && tool.id === "command-button-tilt") {
continue;
}
enabledToolbarButtonsBox.appendChild(createCommandCheckbox(tool));
}
},

View File

@ -691,6 +691,13 @@ Toolbox.prototype = {
if (!button) {
return false;
}
// Disable tilt in E10S mode. Removing it from the list of toolbox buttons
// allows a bunch of tests to pass without modification.
if (this.target.isMultiProcess && options.id === "command-button-tilt") {
return false;
}
return {
id: options.id,
button: button,
@ -698,7 +705,7 @@ Toolbox.prototype = {
visibilityswitch: "devtools." + options.id + ".enabled",
isTargetSupported: options.isTargetSupported ? options.isTargetSupported
: target => target.isLocalTab
}
};
}).filter(button=>button);
},
@ -724,6 +731,18 @@ Toolbox.prototype = {
}
}
});
// Tilt is handled separately because it is disabled in E10S mode. Because
// we have removed tilt from toolboxButtons we have to deal with it here.
let tiltEnabled = !this.target.isMultiProcess &&
Services.prefs.getBoolPref("devtools.command-button-tilt.enabled");
let tiltButton = this.doc.getElementById("command-button-tilt");
if (tiltEnabled) {
tiltButton.removeAttribute("hidden");
} else {
tiltButton.setAttribute("hidden", "true");
}
},
/**

View File

@ -49,6 +49,8 @@ skip-if = buildapp == 'mulet'
[browser_telemetry_button_responsive.js]
[browser_telemetry_button_scratchpad.js]
[browser_telemetry_button_tilt.js]
skip-if = e10s # Bug 1086492 - Disable tilt for e10s
# Bug 937166 - Make tilt work in E10S mode
[browser_telemetry_sidebar.js]
[browser_telemetry_toolbox.js]
[browser_telemetry_toolboxtabs_canvasdebugger.js]

View File

@ -1,5 +1,6 @@
[DEFAULT]
skip-if = e10s # Bug ?????? - devtools tests disabled with e10s
skip-if = e10s # Bug 1086492 - Disable tilt for e10s
# Bug 937166 - Make tilt work in E10S mode
subsuite = devtools
support-files = head.js

View File

@ -20,13 +20,19 @@ exports.items = [
{
name: 'tilt',
description: gcli.lookup("tiltDesc"),
manual: gcli.lookup("tiltManual")
manual: gcli.lookup("tiltManual"),
hidden: true
},
{
name: 'tilt open',
description: gcli.lookup("tiltOpenDesc"),
manual: gcli.lookup("tiltOpenManual"),
hidden: true,
exec: function(args, context) {
if (isMultiProcess(context)) {
return gcli.lookupFormat("notAvailableInE10S", [this.name]);
}
let chromeWindow = context.environment.chromeDocument.defaultView;
let Tilt = TiltManager.getTiltForBrowser(chromeWindow);
if (!Tilt.currentInstance) {
@ -59,6 +65,10 @@ exports.items = [
},
},
exec: function(args, context) {
if (isMultiProcess(context)) {
return gcli.lookupFormat("notAvailableInE10S", [this.name]);
}
let chromeWindow = context.environment.chromeDocument.defaultView;
let Tilt = TiltManager.getTiltForBrowser(chromeWindow);
Tilt.toggle();
@ -68,6 +78,7 @@ exports.items = [
name: 'tilt translate',
description: gcli.lookup("tiltTranslateDesc"),
manual: gcli.lookup("tiltTranslateManual"),
hidden: true,
params: [
{
name: "x",
@ -85,6 +96,10 @@ exports.items = [
}
],
exec: function(args, context) {
if (isMultiProcess(context)) {
return gcli.lookupFormat("notAvailableInE10S", [this.name]);
}
let chromeWindow = context.environment.chromeDocument.defaultView;
let Tilt = TiltManager.getTiltForBrowser(chromeWindow);
if (Tilt.currentInstance) {
@ -96,6 +111,7 @@ exports.items = [
name: 'tilt rotate',
description: gcli.lookup("tiltRotateDesc"),
manual: gcli.lookup("tiltRotateManual"),
hidden: true,
params: [
{
name: "x",
@ -120,6 +136,10 @@ exports.items = [
}
],
exec: function(args, context) {
if (isMultiProcess(context)) {
return gcli.lookupFormat("notAvailableInE10S", [this.name]);
}
let chromeWindow = context.environment.chromeDocument.defaultView;
let Tilt = TiltManager.getTiltForBrowser(chromeWindow);
if (Tilt.currentInstance) {
@ -131,6 +151,7 @@ exports.items = [
name: 'tilt zoom',
description: gcli.lookup("tiltZoomDesc"),
manual: gcli.lookup("tiltZoomManual"),
hidden: true,
params: [
{
name: "zoom",
@ -140,6 +161,10 @@ exports.items = [
}
],
exec: function(args, context) {
if (isMultiProcess(context)) {
return gcli.lookupFormat("notAvailableInE10S", [this.name]);
}
let chromeWindow = context.environment.chromeDocument.defaultView;
let Tilt = TiltManager.getTiltForBrowser(chromeWindow);
@ -152,7 +177,12 @@ exports.items = [
name: 'tilt reset',
description: gcli.lookup("tiltResetDesc"),
manual: gcli.lookup("tiltResetManual"),
hidden: true,
exec: function(args, context) {
if (isMultiProcess(context)) {
return gcli.lookupFormat("notAvailableInE10S", [this.name]);
}
let chromeWindow = context.environment.chromeDocument.defaultView;
let Tilt = TiltManager.getTiltForBrowser(chromeWindow);
@ -165,7 +195,12 @@ exports.items = [
name: 'tilt close',
description: gcli.lookup("tiltCloseDesc"),
manual: gcli.lookup("tiltCloseManual"),
hidden: true,
exec: function(args, context) {
if (isMultiProcess(context)) {
return gcli.lookupFormat("notAvailableInE10S", [this.name]);
}
let chromeWindow = context.environment.chromeDocument.defaultView;
let Tilt = TiltManager.getTiltForBrowser(chromeWindow);
@ -173,3 +208,7 @@ exports.items = [
}
}
];
function isMultiProcess(context) {
return !context.environment.window;
}

View File

@ -20,6 +20,10 @@ helpDesc=Get help on the available commands
# explain the contents of the command help table.
helpAvailable=Available Commands
# LOCALIZATION NOTE (notAvailableInE10S) Used in the output of any command that
# is not compatible with multiprocess mode (E10S).
notAvailableInE10S=The command '%1$S' is not available in multiprocess mode (E10S)
# LOCALIZATION NOTE (consoleDesc) A very short string used to describe the
# function of the console command.
consoleDesc=Commands to control the console