Bug 1487581 - Stop using hardcoded Firefox string in aboutdebugging;r=flod,ladybenko

Depends on D23879

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Julian Descottes 2019-03-20 18:08:36 +00:00
parent 6987dbacc5
commit 7efda3d02e
6 changed files with 29 additions and 16 deletions

View file

@ -12,8 +12,10 @@ const { L10nRegistry } = require("resource://gre/modules/L10nRegistry.jsm");
class L10n {
async init() {
const locales = Services.locale.appLocalesAsBCP47;
const generator = L10nRegistry.generateBundles(locales,
["devtools/aboutdebugging.ftl"]);
const generator = L10nRegistry.generateBundles(locales, [
"branding/brand.ftl",
"devtools/aboutdebugging.ftl",
]);
this._bundles = [];
for await (const bundle of generator) {

View file

@ -26,7 +26,8 @@ add_task(async function() {
const connectLink = connectSidebarItem.querySelector(".js-sidebar-link");
ok(connectSidebarItem, "Found the Connect sidebar item");
const thisFirefoxSidebarItem = findSidebarItemByText("This Firefox", document);
const thisFirefoxString = getThisFirefoxString(window);
const thisFirefoxSidebarItem = findSidebarItemByText(thisFirefoxString, document);
const thisFirefoxLink = thisFirefoxSidebarItem.querySelector(".js-sidebar-link");
ok(thisFirefoxSidebarItem, "Found the ThisFirefox sidebar item");
ok(isSidebarItemSelected(thisFirefoxSidebarItem),

View file

@ -44,7 +44,8 @@ add_task(async function() {
await waitUntil(() => findDebugTargetByText(WORKER_NAME, document));
info("Go to This Firefox again");
const thisFirefoxSidebarItem = findSidebarItemByText("This Firefox", document);
const thisFirefoxString = getThisFirefoxString(window);
const thisFirefoxSidebarItem = findSidebarItemByText(thisFirefoxString, document);
const thisFirefoxLink = thisFirefoxSidebarItem.querySelector(".js-sidebar-link");
info("Click on the ThisFirefox item in the sidebar");
const requestsSuccess = waitForRequestsSuccess(window.AboutDebugging.store);

View file

@ -21,11 +21,13 @@ add_task(async function() {
const { document, tab, window } = await openAboutDebugging();
await selectThisFirefoxPage(document, window.AboutDebugging.store);
// Check that the selected sidebar item is "This Firefox"
// Check that the selected sidebar item is "This Firefox"/"This Nightly"/...
const selectedSidebarItem = document.querySelector(".js-sidebar-item-selected");
ok(selectedSidebarItem, "An item is selected in the sidebar");
is(selectedSidebarItem.textContent, "This Firefox",
"The selected sidebar item is This Firefox");
const thisFirefoxString = getThisFirefoxString(window);
is(selectedSidebarItem.textContent, thisFirefoxString,
"The selected sidebar item is " + thisFirefoxString);
const paneTitlesEls = document.querySelectorAll(".js-debug-target-pane-title");
is(paneTitlesEls.length, EXPECTED_TARGET_PANES.length,

View file

@ -288,3 +288,13 @@ async function openProfilerDialog(client, doc) {
info("Wait for the loadPerformanceProfiler callback to be executed on client-wrapper");
return onProfilerLoaded;
}
/**
* The "This Firefox" string depends on the brandShortName, which will be different
* depending on the channel where tests are running.
*/
function getThisFirefoxString(aboutDebuggingWindow) {
const loader = aboutDebuggingWindow.getBrowserLoaderForWindow();
const { l10n } = loader.require("devtools/client/aboutdebugging-new/src/modules/l10n");
return l10n.getString("about-debugging-this-firefox-runtime-name");
}

View file

@ -15,12 +15,9 @@ about-debugging-page-title-runtime-page = Debugging - Runtime / { $selectedRunti
# Sidebar strings
# Display name of the runtime "This Firefox". Reused as the sidebar name for This Firefox
# (about-debugging-sidebar-this-firefox.name). Not displayed elsewhere in the application
# at the moment.
# This should the same string as the part outside of the parentheses in toolbox.properties
# toolbox.debugTargetInfo.runtimeLabel.thisFirefox. See Bug 1520525.
about-debugging-this-firefox-runtime-name = This Firefox
# Display name of the runtime for the currently running instance of Firefox. Used in the
# Sidebar and in the Setup page.
about-debugging-this-firefox-runtime-name = This { -brand-shorter-name }
# Sidebar heading for selecting the currently running instance of Firefox
about-debugging-sidebar-this-firefox =
@ -83,7 +80,7 @@ about-debugging-setup-intro = Configure the connection method you wish to remote
about-debugging-setup-link-android-devices = View list of supported Android devices
# Explanatory text in the Setup page about what the 'This Firefox' page is for
about-debugging-setup-this-firefox = Use <a>This Firefox</a> to debug tabs, extensions and service workers on this version of Firefox.
about-debugging-setup-this-firefox = Use <a>{ about-debugging-this-firefox-runtime-name }</a> to debug tabs, extensions and service workers on this version of { -brand-shorter-name }.
# Title of the heading Connect section of the Setup page.
about-debugging-setup-connect-heading = Connect a Device
@ -92,7 +89,7 @@ about-debugging-setup-connect-heading = Connect a Device
about-debugging-setup-usb-title = USB
# Explanatory text displayed in the Setup page when USB debugging is disabled
about-debugging-setup-usb-disabled = Enabling this will download and add the required Android USB debugging components to Firefox.
about-debugging-setup-usb-disabled = Enabling this will download and add the required Android USB debugging components to { -brand-shorter-name }.
# Text of the button displayed in the USB section of the setup page when USB debugging is disabled.
# Clicking on it will download components needed to debug USB Devices remotely.
@ -197,7 +194,7 @@ about-debugging-runtime-version-too-old-67-debugger = The Debugger panel may not
# { $localID } is the build ID of the current Firefox instance (same format)
# { $runtimeVersion } is the version of the remote runtime (for instance "67.0a1")
# { $localVersion } is the version of your current runtime (same format)
about-debugging-runtime-version-too-recent = The connected runtime is more recent ({ $runtimeVersion }, buildID { $runtimeID }) than your desktop Firefox ({ $localVersion }, buildID { $localID }). This is an unsupported setup and may cause DevTools to fail. Please update Firefox. <a>Troubleshooting</a>
about-debugging-runtime-version-too-recent = The connected runtime is more recent ({ $runtimeVersion }, buildID { $runtimeID }) than your { -brand-shorter-name } ({ $localVersion }, buildID { $localID }). This is an unsupported setup and may cause DevTools to fail. Please update Firefox. <a>Troubleshooting</a>
# Displayed for runtime info in runtime pages.
# { $name } is brand name such as "Firefox Nightly"