Bug 1314057 - Remove new-debugger-frontend flag from framework devtool when not defaulted to true r=davidwalsh

--HG--
extra : histedit_source : cd24b9bc0b62bb6c78a90619f0172a0eb5fe22e7
This commit is contained in:
David Walsh 2018-09-17 07:43:12 -05:00
Родитель fba376c0ce
Коммит 088e31f9d2
8 изменённых файлов: 19 добавлений и 55 удалений

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

@ -45,6 +45,7 @@ support-files =
test_browser_toolbox_debugger.js
!/devtools/client/debugger/new/test/mochitest/head.js
!/devtools/client/debugger/new/test/mochitest/helpers.js
!/devtools/client/debugger/new/test/mochitest/helpers/context.js
!/devtools/client/shared/test/frame-script-utils.js
!/devtools/client/shared/test/shared-head.js
!/devtools/client/shared/test/shared-redux-head.js

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

@ -19,6 +19,7 @@ const { fetch } = require("devtools/shared/DevToolsUtils");
const debuggerHeadURL = CHROME_URL_ROOT + "../../debugger/new/test/mochitest/head.js";
const helpersURL = CHROME_URL_ROOT + "../../debugger/new/test/mochitest/helpers.js";
const helpersContextURL = CHROME_URL_ROOT + "../../debugger/new/test/mochitest/helpers/context.js";
const testScriptURL = CHROME_URL_ROOT + "test_browser_toolbox_debugger.js";
add_task(async function runTest() {
@ -124,14 +125,15 @@ add_task(async function runTest() {
// Then inject new debugger head file
let { content: debuggerHead } = await fetch(debuggerHeadURL);
// We remove its import of shared-head, which isn't available in browser toolbox process
// And isn't needed thanks to testHead's symbols
debuggerHead = debuggerHead.replace(/Services.scriptloader.loadSubScript[^\)]*\);/g, "");
// Also include the debugger helpers which are separated from debugger's head to be
// reused in other modules.
const { content: debuggerHelpers } = await fetch(helpersURL);
debuggerHead = debuggerHead + debuggerHelpers;
const { content: debuggerContextHelpers } = await fetch(helpersContextURL);
debuggerHead = debuggerHead + debuggerContextHelpers + debuggerHelpers;
// We remove its import of shared-head, which isn't available in browser toolbox process
// And isn't needed thanks to testHead's symbols
debuggerHead = debuggerHead.replace(/Services.scriptloader.loadSubScript[^\)]*\);/g, "");
// Finally, fetch the debugger test script that is going to be execute in the browser
// toolbox process

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

@ -14,12 +14,6 @@ let panelWin = null;
const URL = "data:text/html;charset=utf8,test split console key delegation";
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function() {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
add_task(async function() {
const tab = await addTab(URL);
const target = TargetFactory.forTab(tab);

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

@ -11,12 +11,6 @@
var URL = `${URL_ROOT}doc_viewsource.html`;
var JS_URL = `${URL_ROOT}code_math.js`;
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function() {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
async function viewSource() {
const toolbox = await openNewTabAndToolbox(URL);
@ -26,14 +20,7 @@ async function viewSource() {
ok(debuggerPanel, "The debugger panel was opened.");
is(toolbox.currentToolId, "jsdebugger", "The debugger panel was selected.");
const { DebuggerView } = debuggerPanel.panelWin;
const Sources = DebuggerView.Sources;
is(Sources.selectedValue, getSourceActor(Sources, JS_URL),
"The correct source is shown in the debugger.");
is(DebuggerView.editor.getCursor().line + 1, 2,
"The correct line is highlighted in the debugger's source editor.");
assertSelectedLocationInDebugger(debuggerPanel, 2, undefined);
await closeToolboxAndTab(toolbox);
finish();
}

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

@ -10,26 +10,9 @@
var URL = `${URL_ROOT}doc_viewsource.html`;
var JS_URL = `${URL_ROOT}code_math.js`;
// Force the old debugger UI since it's directly used (see Bug 1301705)
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", false);
registerCleanupFunction(function() {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");
});
async function viewSource() {
const toolbox = await openNewTabAndToolbox(URL);
const { panelWin: debuggerWin } = await toolbox.selectTool("jsdebugger");
const debuggerEvents = debuggerWin.EVENTS;
const { DebuggerView } = debuggerWin;
const Sources = DebuggerView.Sources;
await debuggerWin.once(debuggerEvents.SOURCE_SHOWN);
ok("A source was shown in the debugger.");
is(Sources.selectedValue, getSourceActor(Sources, JS_URL),
"The correct source is initially shown in the debugger.");
is(DebuggerView.editor.getCursor().line, 0,
"The correct line is initially highlighted in the debugger's source editor.");
await toolbox.selectTool("jsdebugger");
await toolbox.viewSourceInDebugger(JS_URL, 2);
@ -37,10 +20,7 @@ async function viewSource() {
ok(debuggerPanel, "The debugger panel was opened.");
is(toolbox.currentToolId, "jsdebugger", "The debugger panel was selected.");
is(Sources.selectedValue, getSourceActor(Sources, JS_URL),
"The correct source is shown in the debugger.");
is(DebuggerView.editor.getCursor().line + 1, 2,
"The correct line is highlighted in the debugger's source editor.");
assertSelectedLocationInDebugger(debuggerPanel, 2, undefined);
await closeToolboxAndTab(toolbox);
finish();

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

@ -371,3 +371,11 @@ async function resizeWindow(toolbox, width, height) {
hostWindow.resizeTo(toWidth, toHeight);
await onResize;
}
function assertSelectedLocationInDebugger(debuggerPanel, line, column) {
const location = debuggerPanel._selectors.getSelectedLocation(
debuggerPanel._getState()
);
is(location.line, line);
is(location.column, column);
}

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

@ -368,11 +368,6 @@ OptionsPanel.prototype = {
// Labels for these new buttons are nightly only and mostly intended for working on
// devtools.
const prefDefinitions = [{
pref: "devtools.debugger.new-debugger-frontend",
label: L10N.getStr("toolbox.options.enableNewDebugger.label"),
id: "devtools-new-debugger",
parentId: "debugger-options"
}, {
pref: "devtools.performance.new-panel-enabled",
label: "Enable new performance recorder (then re-open DevTools)",
id: "devtools-new-performance",

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

@ -19,9 +19,6 @@ const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
"test-stacktrace-location-debugger-link.html";
add_task(async function() {
// Force the new debugger UI, in case this gets uplifted with the old
// debugger still turned on
Services.prefs.setBoolPref("devtools.debugger.new-debugger-frontend", true);
Services.prefs.setBoolPref("devtools.webconsole.filter.log", true);
registerCleanupFunction(async function() {
Services.prefs.clearUserPref("devtools.debugger.new-debugger-frontend");