Skip to content

Commit b7f3065

Browse files
niklasbaumgardnerrvandermeulen
authored andcommitted
Bug 1958537 - Firefox refresh quick action should only be visible for supported profiles. a=RyanVM DONTBUILD
Original Revision: https://phabricator.services.mozilla.com/D261641 Differential Revision: https://phabricator.services.mozilla.com/D263524
1 parent 74769e9 commit b7f3065

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

browser/components/urlbar/QuickActionsLoaderDefault.sys.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ const DEFAULT_ACTIONS = {
172172
refresh: {
173173
l10nCommands: ["quickactions-cmd-refresh"],
174174
label: "quickactions-refresh",
175+
isVisible: () => lazy.ResetProfile.resetSupported(),
175176
onPick: () => {
176177
lazy.ResetProfile.openConfirmationDialog(
177178
lazy.BrowserWindowTracker.getTopWindow()

browser/components/urlbar/tests/browser/browser_quickactions.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ ChromeUtils.defineESModuleGetters(this, {
1414
"resource:///modules/ActionsProviderQuickActions.sys.mjs",
1515
});
1616

17+
Services.scriptloader.loadSubScript(
18+
"chrome://mochitests/content/browser/browser/components/urlbar/tests/browser-tips/head.js",
19+
this
20+
);
21+
1722
const DUMMY_PAGE =
1823
"https://example.com/browser/browser/base/content/test/general/dummy_page.html";
1924

@@ -206,6 +211,20 @@ async function doAlertDialogTest({ input, dialogContentURI }) {
206211
}
207212

208213
add_task(async function test_refresh() {
214+
// Refresh should be disabled because we are not in a named profile yet
215+
await UrlbarTestUtils.promiseAutocompleteResultPopup({
216+
window,
217+
value: "refresh",
218+
});
219+
Assert.equal(
220+
UrlbarTestUtils.getResultCount(window),
221+
1,
222+
"We did not match anything"
223+
);
224+
225+
// Make this a named profile so we can refresh
226+
makeProfileResettable();
227+
209228
await doAlertDialogTest({
210229
input: "refresh",
211230
dialogContentURI: "chrome://global/content/resetProfile.xhtml",

0 commit comments

Comments
 (0)