Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/fast/events/mouse-up-preventDefault-dragstate.html |
| diff --git a/third_party/WebKit/LayoutTests/fast/events/mouse-up-preventDefault-dragstate.html b/third_party/WebKit/LayoutTests/fast/events/mouse-up-preventDefault-dragstate.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5d4db2a8331f0444ba916fd1b2c8c88ae8e6cc83 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/fast/events/mouse-up-preventDefault-dragstate.html |
| @@ -0,0 +1,47 @@ |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| + |
| +<body onload="runTest()"> |
|
bokan
2016/07/01 19:27:29
nit: omit body tag, use window.onload or addEventL
Navid Zolghadr
2016/07/04 14:58:11
Done.
|
| + |
| +<style> |
| +#target { |
| + width: 200px; |
| + height: 200px; |
| +} |
| +</style> |
| + |
| +<p>This is the top level window.</p> |
| +<p>Click somewhere. Move the mouse into the iframe.</p> |
| +<p>Mouse move should be received by the iframe.</p> |
| +<iframe id="target" srcdoc=" |
| +<p>This is the iframe.</p> |
| +<script> |
| + document.addEventListener('mousemove', function() { |
| + parent.mouseMoveReceived(); |
| + }); |
| +</script> |
| +"></iframe> |
| + |
| +<script type="text/javascript"> |
|
bokan
2016/07/01 19:27:29
nit: no need for `type` attribute
Navid Zolghadr
2016/07/04 14:58:11
Done.
|
| + var test_mousemove = async_test("Inner frame should receive mousemove even when mouseup preventDefault was called in the parent iframe."); |
|
bokan
2016/07/01 19:27:29
nit: s/called in the parent iframe/called in the p
Navid Zolghadr
2016/07/04 14:58:11
Done.
|
| + var state = 0; |
|
bokan
2016/07/01 19:27:29
nit: state -> mouseUpPrevented or similar and make
Navid Zolghadr
2016/07/04 14:58:11
Done.
|
| + function mouseMoveReceived() { |
| + if (state == 1) |
| + test_mousemove.done(); |
| + } |
| + document.addEventListener("mouseup", function(e) { |
| + e.preventDefault(); |
| + state = 1; |
| + }); |
| + |
| + function runTest() { |
| + if (window.eventSender) { |
| + var targetRect = document.getElementById("target").getBoundingClientRect(); |
| + eventSender.mouseMoveTo(targetRect.right+10, targetRect.bottom+10); |
| + eventSender.mouseDown(0); |
| + eventSender.mouseUp(0); |
| + eventSender.mouseMoveTo(targetRect.right-10, targetRect.bottom-10); |
| + } |
| + } |
| +</script> |
| +</body> |