Bug 991347 - Hide the displaying of the canvas editor when debugging an addon target. r=vp

This commit is contained in:
Jordan Santell 2014-04-02 16:28:18 -07:00
parent fe77cf2b9b
commit 4a6cb4cded
2 changed files with 17 additions and 2 deletions

View File

@ -7,7 +7,12 @@
const ADDON3_URL = EXAMPLE_URL + "addon3.xpi";
let gAddon, gClient, gThreadClient, gDebugger, gSources;
let PREFS = [
"devtools.canvasdebugger.enabled",
"devtools.shadereditor.enabled",
"devtools.profiler.enabled",
"devtools.netmonitor.enabled"
];
function test() {
Task.spawn(function () {
if (!DebuggerServer.initialized) {
@ -15,6 +20,13 @@ function test() {
DebuggerServer.addBrowserActors();
}
// Store and enable all optional dev tools panels
let originalPrefs = PREFS.map(pref => {
let original = Services.prefs.getBoolPref(pref);
Services.prefs.setBoolPref(pref, true)
return original;
});
gBrowser.selectedTab = gBrowser.addTab();
let iframe = document.createElement("iframe");
document.documentElement.appendChild(iframe);
@ -37,6 +49,9 @@ function test() {
yield closeConnection();
yield debuggerPanel._toolbox.destroy();
iframe.remove();
PREFS.forEach((pref, i) => Services.prefs.setBoolPref(pref, originalPrefs[i]));
finish();
});
}

View File

@ -214,7 +214,7 @@ Tools.canvasDebugger = {
tooltip: l10n("ToolboxCanvasDebugger.tooltip", canvasDebuggerStrings),
isTargetSupported: function(target) {
return true;
return !target.isAddon;
},
build: function(iframeWindow, toolbox) {