Marc Seibert 2023-04-17 10:31:35 +00:00
Родитель 62e4636c9a
Коммит 1c6c622a04
3 изменённых файлов: 60 добавлений и 0 удалений

Просмотреть файл

@ -625,6 +625,10 @@
data-l10n-args='{ "isVisible": false }'
oncommand="SidebarUI.toggle('viewBookmarksSidebar');"
key="viewBookmarksSidebarKb"/>
<menuitem id="BMB_searchBookmarks"
class="subviewbutton"
data-l10n-id="bookmarks-search"
oncommand="PlacesCommandHook.searchBookmarks();"/>
<!-- NB: temporary solution for bug 985024, this should go away soon. -->
<menuitem id="BMB_bookmarksShowAllTop"
class="subviewbutton"

Просмотреть файл

@ -27,6 +27,7 @@ support-files =
add_search_engine_two.html
[browser_click_row_border.js]
[browser_contextualsearch.js]
[browser_search_bookmarks_from_bookmarks_menu.js]
[browser_shortcuts_add_search_engine.js]
support-files =
add_search_engine_many.html

Просмотреть файл

@ -0,0 +1,55 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
add_task(async function searchBookmarksFromBooksmarksMenu() {
// Add Button to toolbar
CustomizableUI.addWidgetToArea(
"bookmarks-menu-button",
CustomizableUI.AREA_NAVBAR,
0
);
let bookmarksMenuButton = document.getElementById("bookmarks-menu-button");
ok(bookmarksMenuButton, "Bookmarks Menu Button added");
// Open Bookmarks-Menu-Popup
let bookmarksMenuPopup = document.getElementById("BMB_bookmarksPopup");
let PopupShownPromise = BrowserTestUtils.waitForEvent(
bookmarksMenuPopup,
"popupshown"
);
EventUtils.synthesizeMouseAtCenter(bookmarksMenuButton, {
type: "mousedown",
});
await PopupShownPromise;
ok(true, "Bookmarks Menu Popup shown");
// Click on 'Search Bookmarks'
let searchBookmarksButton = document.getElementById("BMB_searchBookmarks");
ok(
BrowserTestUtils.is_visible(
searchBookmarksButton,
"'Search Bookmarks Button' is visible."
)
);
EventUtils.synthesizeMouseAtCenter(searchBookmarksButton, {});
await new Promise(resolve => {
window.gURLBar.controller.addQueryListener({
onViewOpen() {
window.gURLBar.controller.removeQueryListener(this);
resolve();
},
});
});
// Verify URLBar is in search mode with correct restriction
is(
gURLBar.searchMode?.source,
UrlbarUtils.RESULT_SOURCE.BOOKMARKS,
"Addressbar in correct mode."
);
CustomizableUI.reset();
});