forked from Floorp-Projects/Floorp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1819980 - Add test for this issue. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D171651
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
browser/components/customizableui/test/browser_bookmarks_empty_message.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
}); |