Skip to content

Commit

Permalink
Bug 1819980 - Add test for this issue. r=Gijs
Browse files Browse the repository at this point in the history
  • Loading branch information
emilio committed Mar 6, 2023
1 parent dfa9a61 commit 132ae9b
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
1 change: 1 addition & 0 deletions browser/components/customizableui/test/browser.ini
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ skip-if = verify
tags = overflowable-toolbar
[browser_addons_area.js]
[browser_allow_dragging_removable_false.js]
[browser_bookmarks_empty_message.js]
[browser_bookmarks_toolbar_collapsed_restore_default.js]
[browser_bookmarks_toolbar_shown_newtab.js]
[browser_bootstrapped_custom_toolbar.js]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */

"use strict";

add_task(async function empty_message_on_non_empty_bookmarks_toolbar() {
await resetCustomization();
ok(CustomizableUI.inDefaultState, "Default state to begin");

await SpecialPowers.pushPrefEnv({
set: [["browser.toolbars.bookmarks.visibility", "always"]],
});

CustomizableUI.removeWidgetFromArea("import-button");
CustomizableUI.removeWidgetFromArea("personal-bookmarks");
CustomizableUI.addWidgetToArea(
"bookmarks-menu-button",
CustomizableUI.AREA_BOOKMARKS,
0
);

let newWin = await BrowserTestUtils.openNewBrowserWindow();
let doc = newWin.document;
ok(
BrowserTestUtils.is_visible(doc.getElementById("PersonalToolbar")),
"Personal toolbar should be visible"
);
ok(
doc.getElementById("personal-toolbar-empty").hidden,
"Empty message should be hidden"
);

await BrowserTestUtils.closeWindow(newWin);
await resetCustomization();
});

0 comments on commit 132ae9b

Please sign in to comment.