Bug 1388029 - make test messages of browser_menu_touch.js more descriptive, r?johannh draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Mon, 13 Nov 2017 14:05:39 +0000
changeset 697177 781e2533e2cc81856c89d6a677183988bea9258f
parent 697176 a5fd09e13572385485be04a780c7f3d968c4757c
child 740040 2fe7d90ea2843b3387aa399246ed3245e33c682d
push id88916
push userbmo:gijskruitbosch+bugs@gmail.com
push dateMon, 13 Nov 2017 14:22:40 +0000
reviewersjohannh
bugs1388029
milestone59.0a1
Bug 1388029 - make test messages of browser_menu_touch.js more descriptive, r?johannh MozReview-Commit-ID: BEs6I38l7j6
browser/base/content/test/touch/browser_menu_touch.js
--- 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({