Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/external/wpt/uievents/mouse/mouseevent_move_button-manual.html |
| diff --git a/third_party/WebKit/LayoutTests/external/wpt/uievents/mouse/mouseevent_move_button-manual.html b/third_party/WebKit/LayoutTests/external/wpt/uievents/mouse/mouseevent_move_button-manual.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..353447e209e5d9c6e1fe27a8a4a44d186381bdd0 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/external/wpt/uievents/mouse/mouseevent_move_button-manual.html |
| @@ -0,0 +1,82 @@ |
| +<!doctype html> |
| +<html> |
| + <head> |
| + <title>Mouse Events with button depressed</title> |
| + <meta name="viewport" content="width=device-width"> |
| + <script src="/resources/testharness.js"></script> |
| + <script src="/resources/testharnessreport.js"></script> |
| + <style> |
| + div.box { |
| + border: 2px solid lightgray; |
| + margin: 25px; |
| + padding: 25px; |
| + float: left; |
| + } |
| + #lightyellow { |
| + background-color: lightyellow; |
| + } |
| + #lightblue { |
| + background-color: lightblue; |
| + } |
| + #lightgreen { |
| + background-color: lightgreen; |
| + } |
| + </style> |
| + </head> |
| + <body onload="run()"> |
| + <h2>Mouse Events</h2> |
| + <h4>Test Description: This test checks if mouse events set button property correctly |
| + <ol> |
| + <li>Put your mouse over the green rectangle</li> |
| + <li>Press a non-primary button and hold it</li> |
|
Navid Zolghadr
2017/04/25 15:45:08
nit: Since you are asking for any non-primary butt
dtapuska
2017/04/25 17:38:43
Done.
|
| + <li>Drag mouse to blue rectangle</li> |
| + <li>Release mouse button</li> |
| + </ol> |
| + </h4> |
| + <div class="box" id="lightyellow"> |
| + <div class="box" id="lightgreen"></div> |
| + <div class="box" id="lightblue"></div> |
| + </div> |
| + <script> |
| + var test = async_test("mouse events fired without button state"); |
| + |
| + var button = -1; |
| + |
| + function run() { |
| + var lightgreen = document.getElementById("lightgreen"); |
| + var lightyellow = document.getElementById("lightyellow"); |
| + var lightblue = document.getElementById("lightblue"); |
| + |
| + on_event(lightgreen, "mousedown", function (event) { |
| + test.step(function() {assert_true(button === -1, "There must only be one mouse down event.");}); |
| + test.step(function() {assert_true(event.button != 0, "Must not be primary button.");}); |
| + button = event.button; |
| + }); |
| + on_event(lightgreen, "click", function (event) { |
|
Navid Zolghadr
2017/04/25 15:45:09
nit: Although our current implementation sends the
dtapuska
2017/04/25 17:38:43
Done.
|
| + test.step(function() {assert_true(event.button === button, "Button must be the same as mousedown.");}); |
| + }); |
| + on_event(lightyellow, "mousemove", function (event) { |
| + if (button != -1) { |
| + test.step(function() {assert_true(event.button === 0, "Button must be un-initialized for mousemove.");}); |
| + } |
| + }); |
| + on_event(lightgreen, "mouseleave", function (event) { |
| + if (button != -1) { |
| + test.step(function() {assert_true(event.button === 0, "Button must be un-initialized for mouseleave.");}); |
| + } |
| + }); |
| + on_event(lightblue, "mouseenter", function (event) { |
| + if (button != -1) { |
| + test.step(function() {assert_true(event.button === 0, "Button must be un-initialized for mouseenter.");}); |
| + } |
| + }); |
| + on_event(lightblue, "mouseup", function (event) { |
| + if (button != -1) { |
| + test.step(function() {assert_true(event.button === button, "Button must be the same as mousedown.");}); |
| + test.done(); |
| + } |
| + }); |
| + } |
| + </script> |
| + </body> |
| +</html> |