Bug 1309678: Logging touch and mouse events in helper_bug1285070.html for easier debugging. r=kats.
authorStone Shih <sshih@mozilla.com>
Tue, 18 Jul 2017 15:41:26 +0800
changeset 418730 95c74751877910cf2649fc6b4c3e2eeca6b7951e
parent 418729 79bc99d25a3ff9f1129537dddaf169e189a3ddab
child 418731 bb33237155278066423e2fdc3de2785eb44a75e7
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1309678, 1285070
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1309678: Logging touch and mouse events in helper_bug1285070.html for easier debugging. r=kats. MozReview-Commit-ID: DJHifeaynOX
gfx/layers/apz/test/mochitest/helper_bug1285070.html
--- a/gfx/layers/apz/test/mochitest/helper_bug1285070.html
+++ b/gfx/layers/apz/test/mochitest/helper_bug1285070.html
@@ -4,39 +4,39 @@
   <meta charset="utf-8">
   <meta name="viewport" content="width=device-width; initial-scale=1.0">
   <title>Test pointer events are dispatched once for touch tap</title>
   <script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
   <script type="application/javascript" src="apz_test_utils.js"></script>
   <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
   <script type="application/javascript">
     function test() {
-      let pointerEventsList = ["pointerover", "pointerenter", "pointerdown",
-                               "pointerup", "pointerleave", "pointerout"];
-      let pointerEventsCount = {};
+      let eventsList = ["pointerover", "pointerenter", "pointerdown",
+                        "pointerup", "pointerleave", "pointerout",
+                        "mousedown", "mouseup",
+                        "touchstart", "touchend", "click"];
+      let eventsCount = {};
 
-      pointerEventsList.forEach((eventName) => {
-        pointerEventsCount[eventName] = 0;
+      eventsList.forEach((eventName) => {
+        eventsCount[eventName] = 0;
         document.getElementById('div1').addEventListener(eventName, (event) => {
-          dump("Received event " + event.type + "\n");
-          ++pointerEventsCount[event.type];
+          ++eventsCount[event.type];
+          ok(true, "Received event " + event.type);
         });
       });
 
       document.addEventListener("click", (event) => {
         is(event.target, document.getElementById('div1'), "Clicked on div (at " + event.clientX + "," + event.clientY + ")");
-        for (var key in pointerEventsCount) {
-          is(pointerEventsCount[key], 1, "Event " + key + " should be generated once");
+        for (var key in eventsCount) {
+          is(eventsCount[key], 1, "Event " + key + " should be generated once");
         }
         subtestDone();
       });
 
-      synthesizeNativeTap(document.getElementById('div1'), 100, 100, () => {
-        dump("Finished synthesizing tap, waiting for div to be clicked...\n");
-      });
+      synthesizeNativeTap(document.getElementById('div1'), 100, 100);
     }
 
     waitUntilApzStable().then(test);
 
   </script>
 </head>
 <body>
   <div id="div1" style="width: 200px; height: 200px; background: black"></div>