Bug 1539461 - Remove the aboutdebugging.new-enabled preference r=remote-debugging-reviewers,daisuke

Depends on D37860

Differential Revision: https://phabricator.services.mozilla.com/D37863

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julian Descottes 2019-07-16 16:24:14 +00:00
Родитель eb34d94bb2
Коммит f1fcf6094f
8 изменённых файлов: 21 добавлений и 81 удалений

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

@ -3,7 +3,7 @@
## What is about:debugging-new
The purpose of about:debugging is to be a debugging hub to start inspecting your addons, processes, tabs and workers. This new version of about:debugging will also allow you to debug remote devices (Firefox for Android on a smartphone). The user should be able to connect either via USB or WiFi. This solution is supposed to replace the various existing remote debugging solutions available in Firefox DevTools, WebIDE and the Connect page.
To try about:debugging-new, the preference `devtools.aboutdebugging.new-enabled` needs to be set to true in `about:config`. After that, the UI is available by typing `about:debugging` in the Firefox URL bar.
To try out about:debugging, type `about:debugging` in the Firefox URL bar.
## Technical overview
@ -16,7 +16,7 @@ The about:debugging-new UI is built using React and Redux. The various React/Red
The folder `devtools/client/aboutdebugging-new/src/modules` contains various helpers and classes that are not related to React/Redux. For instance modules/usb-runtimes.js provides an abstraction layer to enable USB runtimes scanning, to list USB runtimes etc...
### Firefox Component Registration
about:debugging-new is an "about" page registered via a component manifest that is located in `/devtools/startup/aboutdebugging.manifest`. The component registration code is at `/devtools/startup/aboutdebugging-registration.js` and mostly contains the logic to switch between the old and the new about:debugging UI, based on the value of the preference `devtools.aboutdebugging.new-enabled`.
about:debugging-new is an "about" page registered via a component manifest that is located in `/devtools/startup/aboutdebugging.manifest`. The component registration code is at `/devtools/startup/aboutdebugging-registration.js`.
### Actions
Actions should cover all user or external events that change the UI.

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

@ -39,13 +39,6 @@ registerCleanupFunction(async function() {
await remoteClientManager.removeAllClients();
});
/**
* Enable the new about:debugging panel.
*/
async function enableNewAboutDebugging() {
await pushPref("devtools.aboutdebugging.new-enabled", true);
}
async function openAboutDebugging({
enableWorkerUpdates,
enableLocalTabs = true,
@ -61,8 +54,6 @@ async function openAboutDebugging({
enableLocalTabs
);
await enableNewAboutDebugging();
info("opening about:debugging");
const tab = await addTab("about:debugging");

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

@ -26,7 +26,6 @@
*/
const { Cu } = require("chrome");
const Services = require("Services");
loader.lazyRequireGetter(
this,
@ -69,19 +68,6 @@ loader.lazyImporter(
"resource://devtools/client/performance-new/popup/menu-button.jsm"
);
const isAboutDebuggingEnabled = Services.prefs.getBoolPref(
"devtools.aboutdebugging.new-enabled",
false
);
const aboutDebuggingItem = {
id: "menu_devtools_remotedebugging",
l10nKey: "devtoolsRemoteDebugging",
oncommand(event) {
const window = event.target.ownerDocument.defaultView;
gDevToolsBrowser.openAboutDebugging(window.gBrowser);
},
};
exports.menuitems = [
{
id: "menu_devToolbox",
@ -98,7 +84,14 @@ exports.menuitems = [
checkbox: true,
},
{ id: "menu_devtools_separator", separator: true },
...(isAboutDebuggingEnabled ? [aboutDebuggingItem] : []),
{
id: "menu_devtools_remotedebugging",
l10nKey: "devtoolsRemoteDebugging",
oncommand(event) {
const window = event.target.ownerDocument.defaultView;
gDevToolsBrowser.openAboutDebugging(window.gBrowser);
},
},
{
id: "menu_webide",
l10nKey: "webide",

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

@ -357,9 +357,6 @@ pref("devtools.responsive.showUserAgentInput", true);
pref("devtools.responsive.showUserAgentInput", false);
#endif
// Enable new about:debugging.
pref("devtools.aboutdebugging.new-enabled", true);
// Show tab debug targets for This Firefox (on by default for local builds).
#ifdef MOZILLA_OFFICIAL
pref("devtools.aboutdebugging.local-tab-debugging", false);

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

@ -148,13 +148,8 @@ var UI = {
"devtools.webide.zoom"
);
// If the new about:debugging is enabled, show a deprecation message to encourage
// users to open the new Remote Debugging
if (
Services.prefs.getBoolPref("devtools.aboutdebugging.new-enabled", false)
) {
this.showDeprecationMessage();
}
// Show the deprecation message to encourage users to open the new Remote Debugging
this.showDeprecationMessage();
gDevToolsBrowser.isWebIDEInitialized.resolve();
},

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

@ -47,20 +47,15 @@ registerCleanupFunction(() => {
Services.prefs.clearUserPref("devtools.webide.busyTimeout");
Services.prefs.clearUserPref("devtools.webide.lastSelectedProject");
Services.prefs.clearUserPref("devtools.webide.lastConnectedRuntime");
Services.prefs.clearUserPref("devtools.aboutdebugging.new-enabled");
});
var openWebIDE = async function({ autoInstallAddons, newAboutDebugging } = {}) {
var openWebIDE = async function({ autoInstallAddons } = {}) {
info("opening WebIDE");
Services.prefs.setBoolPref(
"devtools.webide.autoinstallADBExtension",
!!autoInstallAddons
);
Services.prefs.setBoolPref(
"devtools.aboutdebugging.new-enabled",
!!newAboutDebugging
);
const win = Services.ww.openWindow(
null,

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

@ -18,29 +18,9 @@
window.onload = function() {
SimpleTest.waitForExplicitFinish();
async function testWithMessageDisabled() {
info("Open WebIDE with the newAboutDebugging preference set to FALSE");
const win = await openWebIDE({
newAboutDebugging: false,
});
const {gDevToolsBrowser} = require("devtools/client/framework/devtools-browser");
await gDevToolsBrowser.isWebIDEInitialized.promise;
ok(true, "WebIDE was initialized");
info("Check if the deprecation message is hidden");
const nbox = win.UI.deprecationBox;
const deprecationMessage = nbox.getNotificationWithValue("webide:deprecationnotification");
ok(!deprecationMessage, "The deprecation message is hidden");
await closeWebIDE(win);
}
async function testWithMessageEnabled() {
info("Open WebIDE with the newAboutDebugging preference set to TRUE");
const win = await openWebIDE({
newAboutDebugging: true,
});
(async function() {
info("Open WebIDE");
const win = await openWebIDE();
const {gDevToolsBrowser} = require("devtools/client/framework/devtools-browser");
await gDevToolsBrowser.isWebIDEInitialized.promise;
@ -69,11 +49,6 @@
await removeTab(mainWindow.gBrowser.selectedTab, mainWindow);
await closeWebIDE(win);
}
(async function() {
await testWithMessageDisabled();
await testWithMessageEnabled();
SimpleTest.finish();
})();

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

@ -4,10 +4,8 @@
"use strict";
// Register the about:debugging URL, that allows to debug various targets such as addons,
// workers and tabs by launching a dedicated DevTools toolbox for the selected target.
// If DevTools are not installed, this about page will display a shim landing page
// encouraging the user to download and install DevTools.
// Register the about:debugging URL, that allows to debug tabs, extensions, workers on
// the current instance of Firefox or on a remote Firefox.
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
const { nsIAboutModule } = Ci;
@ -22,14 +20,10 @@ AboutDebugging.prototype = {
QueryInterface: ChromeUtils.generateQI([nsIAboutModule]),
newChannel: function(_, loadInfo) {
const uri = Services.prefs.getBoolPref(
"devtools.aboutdebugging.new-enabled"
)
? "chrome://devtools/content/aboutdebugging-new/index.html"
: "chrome://devtools/content/aboutdebugging/aboutdebugging.xhtml";
const chan = Services.io.newChannelFromURIWithLoadInfo(
Services.io.newURI(uri),
Services.io.newURI(
"chrome://devtools/content/aboutdebugging-new/index.html"
),
loadInfo
);
chan.owner = Services.scriptSecurityManager.getSystemPrincipal();