Skip to content

Commit

Permalink
Bug 1716822 - Switch to JavaScript stack by default in active tab vie…
Browse files Browse the repository at this point in the history
…w r=julienw

Switches to the JavaScript stacks by default when capturing profile
with active tab view (with the "web developer" preset)
Also refactors previous ternary condition for better readability

Differential Revision: https://phabricator.services.mozilla.com/D119305
  • Loading branch information
piall committed Jul 9, 2021
1 parent faae156 commit f1b127a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions devtools/client/performance-new/browser.js
Expand Up @@ -97,10 +97,12 @@ function receiveProfile(profile, profilerViewMode, getSymbolTableCallback) {
// We automatically open up the "full" mode if no query string is present.
// `undefined` also means nothing is specified, and it should open the "full"
// timeline view in that case.
const viewModeQueryString =
profilerViewMode !== undefined && profilerViewMode !== "full"
? `?view=${profilerViewMode}`
: "";
let viewModeQueryString = "";
if (profilerViewMode === "active-tab") {
viewModeQueryString = "?view=active-tab&implementation=js";
} else if (profilerViewMode !== undefined && profilerViewMode !== "full") {
viewModeQueryString = `?view=${profilerViewMode}`;
}

const tab = browser.addWebTab(
`${baseUrl}${baseUrlPath}${viewModeQueryString}`,
Expand Down
Expand Up @@ -26,7 +26,7 @@ add_task(async function test() {
// with "active-tab" view query string. Frontend will understand and open the active tab view for it.
await openPopupAndAssertUrlForPreset({
preset: "web-developer",
expectedUrl: FRONTEND_BASE_URL + "?view=active-tab",
expectedUrl: FRONTEND_BASE_URL + "?view=active-tab&implementation=js",
});
});

Expand Down

0 comments on commit f1b127a

Please sign in to comment.