Bug 1388029 - make test messages of browser_menu_touch.js more descriptive, r?johannh
MozReview-Commit-ID: BEs6I38l7j6
--- a/browser/base/content/test/touch/browser_menu_touch.js
+++ b/browser/base/content/test/touch/browser_menu_touch.js
@@ -1,67 +1,67 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* This test checks that toolbar menus are in touchmode
* when opened through a touch event. */
async function openAndCheckMenu(menu, target) {
- is(menu.state, "closed", "Menu panel is initally closed.");
+ is(menu.state, "closed", `Menu panel (${menu.id}) is initally closed.`);
let popupshown = BrowserTestUtils.waitForEvent(menu, "popupshown");
EventUtils.synthesizeNativeTapAtCenter(target);
await popupshown;
- is(menu.state, "open", "Menu panel is open.");
- is(menu.getAttribute("touchmode"), "true", "Menu panel is in touchmode.");
+ is(menu.state, "open", `Menu panel (${menu.id}) is open.`);
+ is(menu.getAttribute("touchmode"), "true", `Menu panel (${menu.id}) is in touchmode.`);
menu.hidePopup();
popupshown = BrowserTestUtils.waitForEvent(menu, "popupshown");
EventUtils.synthesizeMouseAtCenter(target, {});
await popupshown;
- is(menu.state, "open", "Menu panel is open.");
- ok(!menu.hasAttribute("touchmode"), "Menu panel is not in touchmode.");
+ is(menu.state, "open", `Menu panel (${menu.id}) is open.`);
+ ok(!menu.hasAttribute("touchmode"), `Menu panel (${menu.id}) is not in touchmode.`);
menu.hidePopup();
}
// The customization UI menu is not attached to the document when it is
// closed and hence requires special attention.
async function openAndCheckCustomizationUIMenu(target) {
EventUtils.synthesizeNativeTapAtCenter(target);
await BrowserTestUtils.waitForCondition(() =>
document.getElementById("customizationui-widget-panel") != null);
let menu = document.getElementById("customizationui-widget-panel");
if (menu.state != "open") {
await BrowserTestUtils.waitForEvent(menu, "popupshown");
- is(menu.state, "open", "Menu is open");
+ is(menu.state, "open", `Menu for ${target.id} is open`);
}
- is(menu.getAttribute("touchmode"), "true", "Menu is in touchmode.");
+ is(menu.getAttribute("touchmode"), "true", `Menu for ${target.id} is in touchmode.`);
menu.hidePopup();
EventUtils.synthesizeMouseAtCenter(target, {});
await BrowserTestUtils.waitForCondition(() =>
document.getElementById("customizationui-widget-panel") != null);
menu = document.getElementById("customizationui-widget-panel");
if (menu.state != "open") {
await BrowserTestUtils.waitForEvent(menu, "popupshown");
- is(menu.state, "open", "Menu is open");
+ is(menu.state, "open", `Menu for ${target.id} is open`);
}
- ok(!menu.hasAttribute("touchmode"), "Menu is not in touchmode.");
+ ok(!menu.hasAttribute("touchmode"), `Menu for ${target.id} 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({