зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 5f9ccc7b6039 (bug 1515810
) for failing in browser_ext_contextMenus.js
This commit is contained in:
Родитель
4784690b43
Коммит
e2736e7ab2
|
@ -563,7 +563,8 @@ function bookmarkContextMenuExtension() {
|
|||
add_task(async function test_bookmark_contextmenu() {
|
||||
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, PAGE);
|
||||
|
||||
await toggleBookmarksToolbar(true);
|
||||
const bookmarksToolbar = document.getElementById("PersonalToolbar");
|
||||
setToolbarVisibility(bookmarksToolbar, true);
|
||||
|
||||
const extension = bookmarkContextMenuExtension();
|
||||
|
||||
|
@ -578,7 +579,7 @@ add_task(async function test_bookmark_contextmenu() {
|
|||
|
||||
await extension.awaitMessage("test-finish");
|
||||
await extension.unload();
|
||||
await toggleBookmarksToolbar(false);
|
||||
setToolbarVisibility(bookmarksToolbar, false);
|
||||
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
|
@ -672,7 +673,8 @@ add_task(async function test_organizer_contextmenu() {
|
|||
});
|
||||
|
||||
add_task(async function test_bookmark_context_requires_permission() {
|
||||
await toggleBookmarksToolbar(true);
|
||||
const bookmarksToolbar = document.getElementById("PersonalToolbar");
|
||||
setToolbarVisibility(bookmarksToolbar, true);
|
||||
|
||||
const extension = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
|
@ -699,5 +701,5 @@ add_task(async function test_bookmark_context_requires_permission() {
|
|||
closeChromeContextMenu("placesContext");
|
||||
|
||||
await extension.unload();
|
||||
await toggleBookmarksToolbar(false);
|
||||
setToolbarVisibility(bookmarksToolbar, false);
|
||||
});
|
||||
|
|
|
@ -165,6 +165,15 @@ add_task(async function test_hiddenPageActionContextMenu() {
|
|||
});
|
||||
|
||||
add_task(async function test_bookmarkContextMenu() {
|
||||
async function showBookmarksToolbar(visible = true) {
|
||||
let bt = document.getElementById("PersonalToolbar");
|
||||
let transitionPromise =
|
||||
BrowserTestUtils.waitForEvent(bt, "transitionend",
|
||||
e => e.propertyName == "max-height");
|
||||
setToolbarVisibility(bt, visible);
|
||||
await transitionPromise;
|
||||
}
|
||||
|
||||
const ext = ExtensionTestUtils.loadExtension({
|
||||
manifest: {
|
||||
permissions: ["menus", "bookmarks"],
|
||||
|
@ -179,7 +188,7 @@ add_task(async function test_bookmarkContextMenu() {
|
|||
},
|
||||
});
|
||||
|
||||
await toggleBookmarksToolbar(true);
|
||||
await showBookmarksToolbar();
|
||||
await ext.startup();
|
||||
await ext.awaitMessage("ready");
|
||||
|
||||
|
@ -192,7 +201,7 @@ add_task(async function test_bookmarkContextMenu() {
|
|||
|
||||
closeChromeContextMenu("placesContext", item);
|
||||
await ext.unload();
|
||||
await toggleBookmarksToolbar(false);
|
||||
await showBookmarksToolbar(false);
|
||||
});
|
||||
|
||||
add_task(async function test_tabContextMenu() {
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
* getBrowserActionPopup getPageActionPopup getPageActionButton
|
||||
* closeBrowserAction closePageAction
|
||||
* promisePopupShown promisePopupHidden
|
||||
* toggleBookmarksToolbar
|
||||
* openContextMenu closeContextMenu
|
||||
* openContextMenuInSidebar openContextMenuInPopup
|
||||
* openExtensionContextMenu closeExtensionContextMenu
|
||||
|
@ -288,16 +287,6 @@ function closeBrowserAction(extension, win = window) {
|
|||
return Promise.resolve();
|
||||
}
|
||||
|
||||
async function toggleBookmarksToolbar(visible = true) {
|
||||
let bookmarksToolbar = document.getElementById("PersonalToolbar");
|
||||
let transitionPromise =
|
||||
BrowserTestUtils.waitForEvent(bookmarksToolbar, "transitionend",
|
||||
e => e.propertyName == "max-height");
|
||||
|
||||
setToolbarVisibility(bookmarksToolbar, visible);
|
||||
await transitionPromise;
|
||||
}
|
||||
|
||||
async function openContextMenuInPopup(extension, selector = "body") {
|
||||
let contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
|
||||
let browser = await awaitExtensionPanel(extension);
|
||||
|
|
Загрузка…
Ссылка в новой задаче