Bug 1507526 [wpt PR 14076] - Revert PR 13640, a=testonly
authorJames Graham <james@hoppipolla.co.uk>
Mon, 19 Nov 2018 18:45:11 +0000
changeset 447539 d3d1eff7e27f18c866e51fed092d03568bf12a9f
parent 447538 46472549acb6dbe8d195bb7c7364f0db31f4144e
child 447540 2536ee5129c2493caab9c597651cafa1d64a3260
push id35082
push userccoroiu@mozilla.com
push dateWed, 21 Nov 2018 21:44:21 +0000
treeherdermozilla-central@fbd97100c83c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1507526, 14076, 13640
milestone65.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 1507526 [wpt PR 14076] - Revert PR 13640, a=testonly Automatic update from web-platform-testsRevert "Update infrastructure/metadata/ to match Chrome and Firefox results" This reverts commit c2bf7c6ed9e3ab9d42000b712d3793f6b58c33cd. -- Revert "Add action_sequence in testdriver" This reverts commit 3287351b606c4588e397632e2ab04641dc91094d. -- wpt-commits: 9e10da29c88d1268b65bac176df3c6ab2ee6a3d5, 02dccc6b5ad45352ae5c3bdf23fcbd9b0deea071 wpt-pr: 14076
testing/web-platform/tests/infrastructure/metadata/infrastructure/testdriver/actions/elementPosition.html.ini
testing/web-platform/tests/infrastructure/metadata/infrastructure/testdriver/actions/eventOrder.html.ini
testing/web-platform/tests/infrastructure/testdriver/actions/elementPosition.html
testing/web-platform/tests/infrastructure/testdriver/actions/eventOrder.html
testing/web-platform/tests/pointerevents/pointerevent_pointermove-manual.html
testing/web-platform/tests/pointerevents/pointerevent_pointermove.html
testing/web-platform/tests/resources/testdriver-actions.js
testing/web-platform/tests/resources/testdriver.js
--- a/testing/web-platform/tests/infrastructure/metadata/infrastructure/testdriver/actions/elementPosition.html.ini
+++ b/testing/web-platform/tests/infrastructure/metadata/infrastructure/testdriver/actions/elementPosition.html.ini
@@ -1,3 +1,3 @@
 [elementPosition.html]
-  [TestDriver actions: element position]
-    expected: FAIL
+  expected:
+    if product == "chrome" or product == "safari" or product == "safari_webdriver": ERROR
--- a/testing/web-platform/tests/infrastructure/metadata/infrastructure/testdriver/actions/eventOrder.html.ini
+++ b/testing/web-platform/tests/infrastructure/metadata/infrastructure/testdriver/actions/eventOrder.html.ini
@@ -1,3 +1,3 @@
 [eventOrder.html]
-  [TestDriver actions: event order]
-    expected: FAIL
+  expected:
+    if product == "chrome" or product == "safari" or product == "safari_webdriver": ERROR
--- a/testing/web-platform/tests/infrastructure/testdriver/actions/elementPosition.html
+++ b/testing/web-platform/tests/infrastructure/testdriver/actions/elementPosition.html
@@ -29,15 +29,15 @@ async_test(t => {
   test.addEventListener("click", e => {
     events.push(e.clientX);
     events.push(e.clientY)
   });
 
   let div = document.getElementById("test");
   let actions = new test_driver.Actions()
     .pointerMove(0, 0, {origin: test})
-    .pointerDown(0, 0, {origin: test})
+    .pointerDown()
     .pointerUp()
     .send()
     .then(t.step_func_done(() => assert_array_equals(events, [50, 25])))
     .catch(e => t.step_func(() => assert_unreached("Actions sequence failed " + e)));
 });
 </script>
--- a/testing/web-platform/tests/infrastructure/testdriver/actions/eventOrder.html
+++ b/testing/web-platform/tests/infrastructure/testdriver/actions/eventOrder.html
@@ -12,24 +12,26 @@
 
 <script>
 // Pointer 1 is added before Pointer 2 so it comes first in the list of sources
 // Therefore its actions happen first
 let events = [];
 
 async_test(t => {
   Array.prototype.forEach.call(document.getElementsByTagName("button"),
-                               (x) => x.addEventListener("pointerdown", () => {events.push(x.id)}));
+                               (x) => x.addEventListener("mousedown", () => {events.push(x.id)}));
 
   let button_a = document.getElementById("a");
   let button_b = document.getElementById("b");
   let actions = new test_driver.Actions()
-    .addPointer("pointer1", "touch")
-    .addPointer("pointer2", "touch")
-    .pointerDown(0, 0, {origin: button_a, sourceName: "pointer1"})
-    .pointerDown(0, 0, {origin: button_b, sourceName: "pointer2"})
+    .addPointer("pointer1")
+    .addPointer("pointer2")
+    .pointerMove(0, 0, {origin: button_a, sourceName: "pointer1"})
+    .pointerMove(0, 0, {origin: button_b, sourceName: "pointer2"})
+    .pointerDown({sourceName: "pointer2"})
+    .pointerDown({sourceName: "pointer1"})
+    .pointerUp({sourceName: "pointer2"})
     .pointerUp({sourceName: "pointer1"})
-    .pointerUp({sourceName: "pointer2"})
     .send()
     .then(t.step_func_done(() => assert_array_equals(events, ["a", "b"])))
     .catch(e => t.step_func(() => assert_unreached("Actions sequence failed " + e)));
 });
 </script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/pointerevents/pointerevent_pointermove-manual.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Pointermove</title>
+        <meta name="viewport" content="width=device-width">
+        <meta name="assert" content="When a pointer changes coordinates, the pointermove event must be dispatched."/>
+        <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
+        <script src="/resources/testharness.js"></script>
+        <script src="/resources/testharnessreport.js"></script>
+        <!-- Additional helper script for common checks across event types -->
+        <script type="text/javascript" src="pointerevent_support.js"></script>
+    </head>
+    <body onload="run()">
+        <h2>PointerMove</h2>
+        <h4>Test Description: This test checks if pointermove event triggers. Move your mouse over the black rectangle or slide it if you are using touchscreen.</h4>
+        <div id="target0" style="background:black"></div>
+        <script>
+            var eventTested = false;
+            var detected_pointertypes = {};
+            var test_pointermove = async_test("pointermove event received");
+            add_completion_callback(showPointerTypes);
+
+            function run() {
+                var target0 = document.getElementById("target0");
+
+                // When a pointer changes coordinates, the pointermove event must be dispatched.
+                // TA: 5.3
+                on_event(target0, "pointermove", function (event) {
+                    detected_pointertypes[event.pointerType] = true;
+                    if (eventTested == false) {
+                        test_pointermove.done();
+                        eventTested = true;
+                    }
+                });
+            }
+        </script>
+        <h1>Pointer Events pointermove Tests</h1>
+        <div id="complete-notice">
+            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
+            <p>Refresh the page to run the tests again with a different pointer type.</p>
+        </div>
+        <div id="log"></div>
+    </body>
+</html>
\ No newline at end of file
deleted file mode 100644
--- a/testing/web-platform/tests/pointerevents/pointerevent_pointermove.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!doctype html>
-<html>
-    <head>
-        <title>Pointermove</title>
-        <meta name="viewport" content="width=device-width">
-        <meta name="assert" content="When a pointer changes coordinates, the pointermove event must be dispatched."/>
-        <link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
-        <script src="/resources/testharness.js"></script>
-        <script src="/resources/testharnessreport.js"></script>
-        <script src="/resources/testdriver.js"></script>
-        <script src="/resources/testdriver-actions.js"></script>
-        <script src="/resources/testdriver-vendor.js"></script>
-        <!-- Additional helper script for common checks across event types -->
-        <script type="text/javascript" src="pointerevent_support.js"></script>
-    </head>
-    <body onload="run()">
-        <h2>PointerMove</h2>
-        <h4>Test Description: This test checks if pointermove event triggers. Move your mouse over the black rectangle or slide it if you are using touchscreen.</h4>
-        <div id="target0" style="background:black"></div>
-        <script>
-            var eventTested = false;
-            var detected_pointertypes = {};
-            var test_pointermove = async_test("pointermove event received");
-            add_completion_callback(showPointerTypes);
-
-            function run() {
-                var target0 = document.getElementById("target0");
-
-                // When a pointer changes coordinates, the pointermove event must be dispatched.
-                // TA: 5.3
-                on_event(target0, "pointermove", function (event) {
-                    detected_pointertypes[event.pointerType] = true;
-                    if (eventTested == false) {
-                        test_pointermove.done();
-                        eventTested = true;
-                    }
-                });
-
-                // Inject the inputs to run this test.
-                new test_driver.Actions().pointerMove(0, 0, {origin: target0}).send();
-            }
-        </script>
-        <h1>Pointer Events pointermove Tests</h1>
-        <div id="complete-notice">
-            <p>The following pointer types were detected: <span id="pointertype-log"></span>.</p>
-            <p>Refresh the page to run the tests again with a different pointer type.</p>
-        </div>
-        <div id="log"></div>
-    </body>
-</html>
\ No newline at end of file
--- a/testing/web-platform/tests/resources/testdriver-actions.js
+++ b/testing/web-platform/tests/resources/testdriver-actions.js
@@ -17,24 +17,16 @@
     for (let sourceType of this.sourceTypes.keys()) {
       this.currentSources.set(sourceType, null);
     }
     this.createSource("general");
     this.tickIdx = 0;
   }
 
   Actions.prototype = {
-    ButtonType: {
-      LEFT: 0,
-      MIDDLE: 1,
-      RIGHT: 2,
-      BACK: 3,
-      FORWARD: 4,
-    },
-
     /**
      * Generate the action sequence suitable for passing to
      * test_driver.action_sequence
      *
      * @returns {Array} Array of WebDriver-compatible actions sequences
      */
     serialize: function() {
       let actions = [];
@@ -101,17 +93,17 @@
     /**
      * Add a new key input source with the given name
      *
      * @param {String} name - Name of the key source
      * @param {Bool} set - Set source as the default key source
      * @returns {Actions}
      */
     addKeyboard: function(name, set=true) {
-      this.createSource("key", name);
+      this.createSource("key", name, true);
       if (set) {
         this.setKeyboard(name);
       }
       return this;
     },
 
     /**
      * Set the current default key source
@@ -128,17 +120,17 @@
      * Add a new pointer input source with the given name
      *
      * @param {String} type - Name of the key source
      * @param {String} pointerType - Type of pointing device
      * @param {Bool} set - Set source as the default key source
      * @returns {Actions}
      */
     addPointer: function(name, pointerType="mouse", set=true) {
-      this.createSource("pointer", name, {pointerType: pointerType});
+      this.createSource("pointer", name, true, {pointerType: pointerType});
       if (set) {
         this.setPointer(name);
       }
       return this;
     },
 
     /**
      * Set the current default pointer source
@@ -228,31 +220,31 @@
     /**
      * Create a pointerDown event for the current default pointer source
      *
      * @param {String} button - Button to press
      * @param {String?} sourceName - Named pointer source to use or null for the default
      *                               pointer source
      * @returns {Actions}
      */
-    pointerDown: function(x, y, {origin="viewport", button=this.ButtonType.LEFT, sourceName=null}={}) {
+    pointerDown: function({button=0, sourceName=null}={}) {
       let source = this.getSource("pointer", sourceName);
-      source.pointerDown(this, button, x, y, origin);
+      source.pointerDown(this, button);
       return this;
     },
 
     /**
      * Create a pointerUp event for the current default pointer source
      *
      * @param {String} button - Button to release
      * @param {String?} sourceName - Named pointer source to use or null for the default pointer
      *                               source
      * @returns {Actions}
      */
-    pointerUp: function({button=this.ButtonType.LEFT, sourceName=null}={}) {
+    pointerUp: function({button=0, sourceName=null}={}) {
       let source = this.getSource("pointer", sourceName);
       source.pointerUp(this, button);
       return this;
     },
 
     /**
      * Create a move event for the current default pointer source
      *
@@ -362,22 +354,22 @@
           actions.push(this.actions.get(i));
         } else {
           actions.push({"type": "pause"});
         }
       }
       return data;
     },
 
-    pointerDown: function(actions, button, x, y, origin) {
+    pointerDown: function(actions, button) {
       let tick = actions.tickIdx;
       if (this.actions.has(tick)) {
         tick = actions.addTick().tickIdx;
       }
-      this.actions.set(tick, {type: "pointerDown", button, x, y, origin});
+      this.actions.set(tick, {type: "pointerDown", button});
     },
 
     pointerUp: function(actions, button) {
       let tick = actions.tickIdx;
       if (this.actions.has(tick)) {
         tick = actions.addTick().tickIdx;
       }
       this.actions.set(tick, {type: "pointerUp", button});
--- a/testing/web-platform/tests/resources/testdriver.js
+++ b/testing/web-platform/tests/resources/testdriver.js
@@ -187,17 +187,17 @@
                                     input source and each input source itself has an actions
                                     property detailing the behaviour of that source at each timestep
                                     (or tick). Authors are not expected to construct the actions
                                     sequence by hand, but to use the builder api provided in
                                     testdriver-actions.js
          * @returns {Promise} fufiled after the actions are performed, or rejected in
          *                    the cases the WebDriver command errors
          */
-        action_sequence: function(actions) {
+        action_sequence(actions) {
             return window.test_driver_internal.action_sequence(actions);
         }
     };
 
     window.test_driver_internal = {
         /**
          * Triggers a user-initiated click
          *
@@ -228,16 +228,16 @@
          */
         freeze: function() {
             return Promise.reject(new Error("unimplemented"));
         },
 
         /**
          * Send a sequence of pointer actions
          *
-         * @returns {Promise} fulfilled after actions are sent, rejected if any actions
+         * @returns {Promise} fufilled after actions are sent, rejected if any actions
          *                    fail
          */
         action_sequence: function(actions) {
             return Promise.reject(new Error("unimplemented"));
         }
     };
 })();