зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1214352 - Enable scratchpad in tab toolboxes. r=jryans
This commit is contained in:
Родитель
035fd15b5c
Коммит
dd4512a3dd
|
@ -10,23 +10,20 @@ const ADDON_URL = EXAMPLE_URL + "addon3.xpi";
|
|||
|
||||
var gAddon, gClient, gThreadClient, gDebugger, gSources;
|
||||
var PREFS = [
|
||||
"devtools.canvasdebugger.enabled",
|
||||
"devtools.shadereditor.enabled",
|
||||
"devtools.performance.enabled",
|
||||
"devtools.netmonitor.enabled"
|
||||
["devtools.canvasdebugger.enabled", true],
|
||||
["devtools.shadereditor.enabled", true],
|
||||
["devtools.performance.enabled", true],
|
||||
["devtools.netmonitor.enabled", true],
|
||||
["devtools.scratchpad.enabled", true]
|
||||
];
|
||||
function test() {
|
||||
Task.spawn(function*() {
|
||||
// Store and enable all optional dev tools panels
|
||||
yield pushPrefs(...PREFS);
|
||||
|
||||
let addon = yield addAddon(ADDON_URL);
|
||||
let addonDebugger = yield initAddonDebugger(ADDON_URL);
|
||||
|
||||
// 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;
|
||||
});
|
||||
|
||||
// Check only valid tabs are shown
|
||||
let tabs = addonDebugger.frame.contentDocument.getElementById("toolbox-tabs").children;
|
||||
let expectedTabs = ["webconsole", "jsdebugger", "scratchpad"];
|
||||
|
@ -46,8 +43,6 @@ function test() {
|
|||
yield addonDebugger.destroy();
|
||||
yield removeAddon(addon);
|
||||
|
||||
PREFS.forEach((pref, i) => Services.prefs.setBoolPref(pref, originalPrefs[i]));
|
||||
|
||||
finish();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@ var TAB_URL = EXAMPLE_URL + "doc_WorkerActor.attachThread-tab.html";
|
|||
var WORKER_URL = "code_WorkerActor.attachThread-worker.js";
|
||||
|
||||
add_task(function* () {
|
||||
yield pushPrefs(["devtools.scratchpad.enabled", true]);
|
||||
|
||||
DebuggerServer.init();
|
||||
DebuggerServer.addBrowserActors();
|
||||
|
||||
|
|
|
@ -386,7 +386,7 @@ Tools.scratchpad = {
|
|||
commands: "devtools/client/scratchpad/scratchpad-commands",
|
||||
|
||||
isTargetSupported: function(target) {
|
||||
return target.isRemote;
|
||||
return target.hasActor("console");
|
||||
},
|
||||
|
||||
build: function(iframeWindow, toolbox) {
|
||||
|
|
|
@ -727,6 +727,10 @@ WorkerTarget.prototype = {
|
|||
destroy: function() {},
|
||||
|
||||
hasActor: function (name) {
|
||||
// console is the only one actor implemented by WorkerActor
|
||||
if (name == "console") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@ function setPrefDefaults() {
|
|||
Services.prefs.setBoolPref("devtools.inspector.showAllAnonymousContent", true);
|
||||
Services.prefs.setBoolPref("browser.dom.window.dump.enabled", true);
|
||||
Services.prefs.setBoolPref("devtools.command-button-noautohide.enabled", true);
|
||||
Services.prefs.setBoolPref("devtools.scratchpad.enabled", true);
|
||||
}
|
||||
|
||||
window.addEventListener("load", function() {
|
||||
|
|
|
@ -215,6 +215,9 @@ pref("devtools.canvasdebugger.enabled", false);
|
|||
// Enable the Web Audio Editor
|
||||
pref("devtools.webaudioeditor.enabled", false);
|
||||
|
||||
// Enable Scratchpad
|
||||
pref("devtools.scratchpad.enabled", false);
|
||||
|
||||
// Web Audio Editor Inspector Width should be a preference
|
||||
pref("devtools.webaudioeditor.inspectorWidth", 300);
|
||||
|
||||
|
|
|
@ -12,10 +12,20 @@ var { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
|
|||
var { Tools } = require("devtools/client/main");
|
||||
var { isTargetSupported } = Tools.scratchpad;
|
||||
|
||||
Tools.scratchpad.isTargetSupported = () => true;
|
||||
function pushPrefEnv() {
|
||||
let deferred = promise.defer();
|
||||
let options = {"set":
|
||||
[["devtools.scratchpad.enabled", true]
|
||||
]};
|
||||
SpecialPowers.pushPrefEnv(options, deferred.resolve);
|
||||
return deferred.promise;
|
||||
}
|
||||
|
||||
add_task(function*() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
yield pushPrefEnv();
|
||||
|
||||
yield loadTab(TEST_URI);
|
||||
|
||||
info("Opening toolbox with Scratchpad panel");
|
||||
|
|
Загрузка…
Ссылка в новой задаче