Bug 1388512 - Fix browser_menu_touch.js on Windows 10. r=jmaher
This test was failing because we need to set an additional
pref to make our Windows 10 test infra support touch events,
and because some elements it was testing got renamed.
MozReview-Commit-ID: 4h2YxFzRrGp
--- a/browser/base/content/test/touch/browser_menu_touch.js
+++ b/browser/base/content/test/touch/browser_menu_touch.js
@@ -56,28 +56,41 @@ async function openAndCheckCustomization
is(menu.state, "open", "Menu is open");
}
ok(!menu.hasAttribute("touchmode"), "Menu is not in touchmode.");
menu.hidePopup();
}
+// Ensure that we can run touch events properly for windows [10]
+add_task(async function setup() {
+ let isWindows = AppConstants.isPlatformAndVersionAtLeast("win", "10.0");
+ await SpecialPowers.pushPrefEnv({
+ set: [
+ ["apz.test.fails_with_native_injection", isWindows]
+ ]
+ });
+});
+
// Test main ("hamburger") menu.
add_task(async function test_main_menu_touch() {
let mainMenu = document.getElementById("appMenu-popup");
let target = document.getElementById("PanelUI-menu-button");
await openAndCheckMenu(mainMenu, target);
});
// Test the page action menu.
add_task(async function test_page_action_panel_touch() {
- let pageActionPanel = document.getElementById("page-action-panel");
- let target = document.getElementById("urlbar-page-action-button");
- await openAndCheckMenu(pageActionPanel, target);
+ // The page action menu only appears on a web page.
+ await BrowserTestUtils.withNewTab("https://example.com", async function() {
+ let pageActionPanel = document.getElementById("pageActionPanel");
+ let target = document.getElementById("pageActionButton");
+ await openAndCheckMenu(pageActionPanel, target);
+ });
});
// Test the customizationUI panel, which is used for various menus
// such as library, history, sync, developer and encoding.
add_task(async function test_customizationui_panel_touch() {
CustomizableUI.addWidgetToArea("library-button", CustomizableUI.AREA_NAVBAR);
CustomizableUI.addWidgetToArea("history-panelmenu", CustomizableUI.AREA_NAVBAR);