Bug 1609356 - Enable application panel in Nightly r=jdescottes

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Belén Albeza 2020-01-21 17:49:02 +00:00
Родитель f9f78c2f75
Коммит fb1055410b
7 изменённых файлов: 50 добавлений и 10 удалений

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

@ -2081,8 +2081,12 @@ pref("devtools.netmonitor.enabled", true);
pref("devtools.netmonitor.features.search", true);
pref("devtools.netmonitor.features.requestBlocking", true);
// Enable the Application panel
pref("devtools.application.enabled", false);
// Enable the Application panel on Nightly
#if defined(NIGHTLY_BUILD)
pref("devtools.application.enabled", true);
#else
pref("devtools.application.enabled", false);
#endif
// The default Network Monitor UI settings
pref("devtools.netmonitor.panes-network-details-width", 550);

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

@ -6,7 +6,7 @@ The Application panel is a Firefox Developer Tools panel meant to allow the insp
### How to enable the Application panel
At the moment, the panel is hidden behind a configuration flag. In order to enable it, type `about:config` in the address bar, look for the `devtools.application.enabled` flag and set it to true. It will then appear as a tab with the rest of the panels within the Developer Tools toolbox.
At the moment, the panel is shown by default on Nightly builds only, behind a configuration flag. In order to enable it, type `about:config` in the address bar, look for the `devtools.application.enabled` flag and set it to true. It will then appear as a tab with the rest of the panels within the Developer Tools toolbox.
## Technical overview

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

@ -465,8 +465,8 @@ Tools.application = {
label: l10n("application.label"),
panelLabel: l10n("application.panellabel"),
tooltip: l10n("application.tooltip"),
inMenu: false,
hiddenInOptions: true,
inMenu: AppConstants.NIGHTLY_BUILD,
hiddenInOptions: !AppConstants.NIGHTLY_BUILD,
isTargetSupported: function(target) {
return target.hasActor("manifest");

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

@ -85,7 +85,7 @@ async function toggleTool({ doc, panelWin, checkbox, tab }, toolId) {
async function checkUnregistered(toolId) {
ok(
!tab1.doc.getElementById("toolbox-tab-" + toolId),
!getToolboxTab(toolId),
`Tab for unregistered tool ${toolId} is not present in first toolbox`
);
ok(
@ -93,7 +93,7 @@ async function checkUnregistered(toolId) {
`Checkbox for unregistered tool ${toolId} is not checked in first toolbox`
);
ok(
!tab2.doc.getElementById("toolbox-tab-" + toolId),
!getToolboxTab(toolId),
`Tab for unregistered tool ${toolId} is not present in second toolbox`
);
ok(
@ -104,7 +104,7 @@ async function checkUnregistered(toolId) {
function checkRegistered(toolId) {
ok(
tab1.doc.getElementById("toolbox-tab-" + toolId),
getToolboxTab(toolId),
`Tab for registered tool ${toolId} is present in first toolbox`
);
ok(
@ -112,7 +112,7 @@ function checkRegistered(toolId) {
`Checkbox for registered tool ${toolId} is checked in first toolbox`
);
ok(
tab2.doc.getElementById("toolbox-tab-" + toolId),
getToolboxTab(toolId),
`Tab for registered tool ${toolId} is present in second toolbox`
);
ok(
@ -121,6 +121,14 @@ function checkRegistered(toolId) {
);
}
function getToolboxTab(toolId) {
// get toolbox either from the tabs, or from the overflow menu
return (
tab1.doc.getElementById(`toolbox-tab-${toolId}`) ||
tab1.doc.getElementById(`tools-chevron-menupopup-${toolId}`)
);
}
async function cleanup() {
await tab1.toolbox.destroy();
await tab2.toolbox.destroy();

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

@ -20,6 +20,8 @@
// * memory
// * netmonitor
// * storage
// * accessibility
// * application
const { Toolbox } = require("devtools/client/framework/toolbox");
@ -33,6 +35,7 @@ const TEST_STARTING_ORDER = [
"netmonitor",
"storage",
"accessibility",
"application",
];
const TEST_DATA = [
{
@ -49,6 +52,7 @@ const TEST_DATA = [
"netmonitor",
"storage",
"accessibility",
"application",
],
},
{
@ -65,6 +69,7 @@ const TEST_DATA = [
"netmonitor",
"storage",
"accessibility",
"application",
],
},
{
@ -90,6 +95,7 @@ const TEST_DATA = [
"memory",
"storage",
"accessibility",
"application",
],
},
{
@ -113,6 +119,7 @@ const TEST_DATA = [
"netmonitor",
"storage",
"accessibility",
"application",
"webconsole",
],
},
@ -122,6 +129,8 @@ add_task(async function() {
// Temporarily disable the panel added in Bug 1594885.
// Should be cleaned up when the panel is properly implemented.
await pushPref("devtools.whatsnew.enabled", false);
// Enable the Application panel (atm it's only available on Nightly)
await pushPref("devtools.application.enabled", true);
const tab = await addTab("about:blank");
const toolbox = await openToolboxForTab(
@ -176,6 +185,7 @@ add_task(async function() {
"memory",
"netmonitor",
"accessibility",
"application",
];
await dndToolTab(toolbox, dragTarget, dropTarget);
assertToolTabSelected(toolbox, dragTarget);

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

@ -19,6 +19,7 @@ const TEST_STARTING_ORDER = [
"netmonitor",
"storage",
"accessibility",
"application",
EXTENSION,
];
@ -26,6 +27,8 @@ add_task(async function() {
// Temporarily disable the panel added in Bug 1594885.
// Should be cleaned up when the panel is properly implemented.
await pushPref("devtools.whatsnew.enabled", false);
// Enable the Application panel (atm it's only available on Nightly)
await pushPref("devtools.application.enabled", true);
const extension = ExtensionTestUtils.loadExtension({
useAddonManager: "temporary",
@ -95,6 +98,7 @@ add_task(async function() {
"netmonitor",
"storage",
"accessibility",
"application",
];
prepareToolTabReorderTest(toolbox, TEST_STARTING_ORDER);
await dndToolTab(toolbox, dragTarget, dropTarget);
@ -118,6 +122,7 @@ add_task(async function() {
"memory",
"netmonitor",
"accessibility",
"application",
EXTENSION,
];
await dndToolTab(toolbox, dragTarget, dropTarget);
@ -139,6 +144,7 @@ add_task(async function() {
"netmonitor",
"storage",
"accessibility",
"application",
];
await dndToolTab(toolbox, dragTarget, dropTarget);
assertToolTabPreferenceOrder(expectedOrder);

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

@ -23,6 +23,7 @@ const TEST_DATA = [
"netmonitor",
"storage",
"accessibility",
"application",
],
dragTarget: "webconsole",
dropTarget: "inspector",
@ -37,6 +38,7 @@ const TEST_DATA = [
"netmonitor",
"storage",
"accessibility",
"application",
],
},
{
@ -52,6 +54,7 @@ const TEST_DATA = [
"netmonitor",
"storage",
"accessibility",
"application",
],
dragTarget: "inspector",
dropTarget: "webconsole",
@ -66,6 +69,7 @@ const TEST_DATA = [
"netmonitor",
"storage",
"accessibility",
"application",
],
},
{
@ -82,6 +86,7 @@ const TEST_DATA = [
"netmonitor",
"storage",
"accessibility",
"application",
],
dragTarget: "webconsole",
dropTarget: "inspector",
@ -96,6 +101,7 @@ const TEST_DATA = [
"netmonitor",
"storage",
"accessibility",
"application",
],
},
{
@ -111,10 +117,11 @@ const TEST_DATA = [
"netmonitor",
"storage",
"accessibility",
"application",
EXTENSION,
],
dragTarget: "webconsole",
dropTarget: "accessibility",
dropTarget: "application",
expectedOrder: [
"inspector",
"jsdebugger",
@ -124,6 +131,7 @@ const TEST_DATA = [
"netmonitor",
"storage",
"accessibility",
"application",
EXTENSION,
"webconsole",
],
@ -134,6 +142,8 @@ add_task(async function() {
// Temporarily disable the panel added in Bug 1594885.
// Should be cleaned up when the panel is properly implemented.
await pushPref("devtools.whatsnew.enabled", false);
// Enable the Application panel (atm it's only available on Nightly)
await pushPref("devtools.application.enabled", true);
registerCleanupFunction(() => {
Services.prefs.clearUserPref("devtools.toolbox.tabsOrder");
@ -200,6 +210,7 @@ add_task(async function() {
"netmonitor",
"storage",
"accessibility",
"application",
];
const dragTarget = "webconsole";
const dropTarget = "inspector";
@ -213,6 +224,7 @@ add_task(async function() {
"netmonitor",
"storage",
"accessibility",
"application",
];
prepareTestWithHiddenExtension(toolbox, startingOrder);
await extension.unload();