Bug 1337133 - Add a wdspec test for mouse actions; r=ato+446296
authorMaja Frydrychowicz <mjzffr@gmail.com>
Mon, 27 Feb 2017 08:32:24 -0500
changeset 394010 47ac31461e9dc8387eabfee6874add93fa39c247
parent 394009 356602cac222cf748f47d3f23a171d2227c9c666
child 394011 fa0e8a07bd1e49ebbb13d75d4dd527815b67dde3
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1337133, 446296
milestone54.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 1337133 - Add a wdspec test for mouse actions; r=ato+446296 Proof of concept to be replaced with more tests in a follow-up. MozReview-Commit-ID: 8FHJOgpO1wr
testing/web-platform/meta/MANIFEST.json
testing/web-platform/meta/webdriver/actions/mouse.py.ini
testing/web-platform/tests/webdriver/actions/mouse.py
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -12849,21 +12849,16 @@
      {}
     ]
    ],
    "./server-side.md": [
     [
      {}
     ]
    ],
-   "./test_keys_wdspec.html": [
-    [
-     {}
-    ]
-   ],
    "./update-built-tests.sh": [
     [
      {}
     ]
    ],
    "2dcontext/2x2.png": [
     [
      {}
@@ -62229,22 +62224,37 @@
      {}
     ]
    ],
    "webdriver/README.md": [
     [
      {}
     ]
    ],
-   "webdriver/support/__init__.py": [
-    [
-     {}
-    ]
-   ],
-   "webdriver/support/keys.py": [
+   "webdriver/actions/__init__.py": [
+    [
+     {}
+    ]
+   ],
+   "webdriver/actions/support/__init__.py": [
+    [
+     {}
+    ]
+   ],
+   "webdriver/actions/support/keys.py": [
+    [
+     {}
+    ]
+   ],
+   "webdriver/actions/support/refine.py": [
+    [
+     {}
+    ]
+   ],
+   "webdriver/actions/support/test_actions_wdspec.html": [
     [
      {}
     ]
    ],
    "webdriver/util/__init__.py": [
     [
      {}
     ]
@@ -129324,19 +129334,37 @@
    "workers/semantics/xhr/006.html": [
     [
      "/workers/semantics/xhr/006.html",
      {}
     ]
    ]
   },
   "wdspec": {
-   "webdriver/actions.py": [
-    [
-     "/webdriver/actions.py",
+   "webdriver/actions/conftest.py": [
+    [
+     "/webdriver/actions/conftest.py",
+     {}
+    ]
+   ],
+   "webdriver/actions/key.py": [
+    [
+     "/webdriver/actions/key.py",
+     {}
+    ]
+   ],
+   "webdriver/actions/mouse.py": [
+    [
+     "/webdriver/actions/mouse.py",
+     {}
+    ]
+   ],
+   "webdriver/actions/sequence.py": [
+    [
+     "/webdriver/actions/sequence.py",
      {}
     ]
    ],
    "webdriver/conftest.py": [
     [
      "/webdriver/conftest.py",
      {}
     ]
@@ -129439,20 +129467,16 @@
   "./serve.py": [
    "0efa39b1f26f86d73f2fce4f9e46003d62057b41",
    "support"
   ],
   "./server-side.md": [
    "c51b17fbac2a2e3121dc74f7badbd2873ce92f61",
    "support"
   ],
-  "./test_keys_wdspec.html": [
-   "13e6f15dcfe080bff5f3b3cbaf9b9f679915aca3",
-   "support"
-  ],
   "./update-built-tests.sh": [
    "75ea35a5ce9d8e3e32e8d0c336dc12e04691d16a",
    "support"
   ],
   "2dcontext/2x2.png": [
    "c67d3f646e86413722833d2308a9bfc793a916bf",
    "support"
   ],
@@ -176936,17 +176960,17 @@
    "2d6949b9226f3347c4957eed623af4bd30bc2d90",
    "testharness"
   ],
   "html/semantics/forms/the-select-element/common-HTMLOptionsCollection-namedItem.html": [
    "a4efd8eac667770cd1258481ed86c7cab169769c",
    "testharness"
   ],
   "html/semantics/forms/the-select-element/common-HTMLOptionsCollection.html": [
-   "de186d5f39bf85cc073ad6262fa933f89a4500d5",
+   "b5a01e973e4d4c97c6fa06bd9fd1e535e8c622e8",
    "testharness"
   ],
   "html/semantics/forms/the-select-element/select-ask-for-reset.html": [
    "e9689464e9ffa86ac5cd9364a4e8fb9ed6af065e",
    "testharness"
   ],
   "html/semantics/forms/the-select-element/select-named-getter.html": [
    "40412a620cb3ae20853c95cae15f3516e5f553da",
@@ -178124,21 +178148,21 @@
    "80e181c338ad5683cb16ab7f6a13742e281fc2ef",
    "testharness"
   ],
   "html/semantics/tabular-data/the-table-element/tBodies.html": [
    "61c6c609ca757bd8c296d6725120e2242d0c6c23",
    "testharness"
   ],
   "html/semantics/tabular-data/the-table-element/tFoot.html": [
-   "8017cabc08b5c10566ce97dee0cecd73d7ee3bce",
+   "ec9513f8c78bed931ac9ea51910d314b46639317",
    "testharness"
   ],
   "html/semantics/tabular-data/the-table-element/tHead.html": [
-   "45cd1c63c80dce76c5a51644fa17f8535846cb54",
+   "96c3470e247189297a84310173392007bad4977d",
    "testharness"
   ],
   "html/semantics/tabular-data/the-table-element/table-insertRow.html": [
    "f9247a743d79d74be54bf70f379a6b8de7ce8cd8",
    "testharness"
   ],
   "html/semantics/tabular-data/the-table-element/table-rows.html": [
    "2d53c9ae50320629158128aa28b5215758d6aeed",
@@ -178192,17 +178216,17 @@
    "8ce5552738730af167b0c3694b9156b82561b1dd",
    "testharness"
   ],
   "html/semantics/tabular-data/the-tr-element/deleteCell.html": [
    "18738872ddc01538cdfb5b796471809010ed1b88",
    "testharness"
   ],
   "html/semantics/tabular-data/the-tr-element/insertCell.html": [
-   "d3e48e89cfc8a9f3478af5c922fea6a59e88135e",
+   "8161e1f20e42a9fe5270cc779dca71ada097cd75",
    "testharness"
   ],
   "html/semantics/tabular-data/the-tr-element/rowIndex.html": [
    "9346daca33cd13a082ed84b77df52b842ed41c55",
    "testharness"
   ],
   "html/semantics/tabular-data/the-tr-element/sectionRowIndex.html": [
    "108f31a4171e31f60e375996ffdc30c5dec74418",
@@ -205831,44 +205855,68 @@
   "webdriver/OWNERS": [
    "ed6ae435828699abe5d1399c6e9bacc7bae7474f",
    "support"
   ],
   "webdriver/README.md": [
    "a4611303723fa7225d7667a1e4fe2495451b824f",
    "support"
   ],
-  "webdriver/actions.py": [
-   "3a857859e17b7965cec7fb1ba2368177f316a395",
+  "webdriver/actions/__init__.py": [
+   "da39a3ee5e6b4b0d3255bfef95601890afd80709",
+   "support"
+  ],
+  "webdriver/actions/conftest.py": [
+   "ba57459c1eb7d792e14e756078eb725f4c07aa6e",
+   "wdspec"
+  ],
+  "webdriver/actions/key.py": [
+   "808f1311409fb70a40bbb995ff7da768d58e43cb",
+   "wdspec"
+  ],
+  "webdriver/actions/mouse.py": [
+   "640ae3074200938ad63f77627d6645efa8c5716e",
    "wdspec"
   ],
+  "webdriver/actions/sequence.py": [
+   "d80f382863e52ff223db735a2a551197e570774f",
+   "wdspec"
+  ],
+  "webdriver/actions/support/__init__.py": [
+   "da39a3ee5e6b4b0d3255bfef95601890afd80709",
+   "support"
+  ],
+  "webdriver/actions/support/keys.py": [
+   "85bfdbd3203166c2b84616cc1936f6dd98f8de3b",
+   "support"
+  ],
+  "webdriver/actions/support/refine.py": [
+   "0d244bffe67ef57be68aad99f1cbc7440ff80e27",
+   "support"
+  ],
+  "webdriver/actions/support/test_actions_wdspec.html": [
+   "63b5de5ab6c7a00717663a18c3b4d79857ee2136",
+   "support"
+  ],
   "webdriver/conftest.py": [
    "9a5d2c122d912af2d53478a3f83ac9da676ba531",
    "wdspec"
   ],
   "webdriver/contexts.py": [
    "cef7ae3987fa61d0b17c616e35c6066ce1e4af83",
    "wdspec"
   ],
   "webdriver/interface.html": [
    "d783d0dd370f58b264ef238d8da5cd8601dc3c7f",
    "testharness"
   ],
   "webdriver/navigation.py": [
    "2216ea3b518ec6b1beef54ce2580b5e62c2841a0",
    "wdspec"
   ],
-  "webdriver/support/__init__.py": [
-   "da39a3ee5e6b4b0d3255bfef95601890afd80709",
-   "support"
-  ],
-  "webdriver/support/keys.py": [
-   "85bfdbd3203166c2b84616cc1936f6dd98f8de3b",
-   "support"
-  ],
   "webdriver/util/__init__.py": [
    "8910ee7d68dfff68460731ea37eb0d406d07862d",
    "support"
   ],
   "webdriver/util/cleanup.py": [
    "b7e2e0707925c0d331fe943612764d677f87ce90",
    "wdspec"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/meta/webdriver/actions/mouse.py.ini
@@ -0,0 +1,5 @@
+[mouse.py]
+  type: wdspec
+  disabled:
+    if (os == "linux") and (bits == 64) and debug: https://bugzilla.mozilla.org/show_bug.cgi?id=1318724
+  expected: CRASH
--- a/testing/web-platform/tests/webdriver/actions/mouse.py
+++ b/testing/web-platform/tests/webdriver/actions/mouse.py
@@ -1,8 +1,31 @@
-from support.refine import get_events
+from support.refine import get_events, filter_dict
 
 
-def test_nothing(session, test_actions_page, mouse_chain):
+def test_click_at_coordinates(session, test_actions_page, mouse_chain):
+    div_point = {
+        "x": 82,
+        "y": 187,
+    }
+    button = 0
     mouse_chain \
-        .pointer_down(0) \
+        .pointer_move(div_point["x"], div_point["y"], duration=1000) \
+        .pointer_down(button) \
+        .pointer_up(button) \
         .perform()
-    assert True
+    events = get_events(session)
+    assert len(events) == 4
+    for e in events:
+        if e["type"] != "mousemove":
+            assert e["pageX"] == div_point["x"]
+            assert e["pageY"] == div_point["y"]
+            assert e["target"] == "outer"
+        if e["type"] != "mousedown":
+            assert e["buttons"] == 0
+        assert e["button"] == button
+    expected = [
+        {"type": "mousedown", "buttons": 1},
+        {"type": "mouseup",  "buttons": 0},
+        {"type": "click", "buttons": 0},
+    ]
+    filtered_events = [filter_dict(e, expected[0]) for e in events]
+    assert expected == filtered_events[1:]