Chromium Code Reviews| Index: LayoutTests/fast/events/event-sender-mouseleave.html |
| diff --git a/LayoutTests/fast/events/event-sender-mouseleave.html b/LayoutTests/fast/events/event-sender-mouseleave.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d361c9e0cdf16cd4feadb3601d435b5cc01f5153 |
| --- /dev/null |
| +++ b/LayoutTests/fast/events/event-sender-mouseleave.html |
| @@ -0,0 +1,38 @@ |
| +<!DOCTYPE html> |
| +<style> |
| +#testBox { |
| + background: blue; |
| + top: 100px; |
| + left: 100px; |
| + width: 100px; |
| + height: 100px; |
| + position: absolute; |
| +} |
| +</style> |
| +<div id="testBox"> |
| +</div> |
| +<p id="description"> |
| +</p> |
| +<script src="../../resources/js-test.js"></script> |
| +<script> |
| + window.jsTestIsAsync = true; |
| + |
| + description('Test that a mouse leave event is triggered.'); |
|
Rick Byers
2015/03/06 16:05:37
nit add: "when the OS tells us the mouse has left
Miyoung Shin(g)
2015/03/09 15:47:27
Done.
|
| + var hasMouseLeave = false; |
| + var hasMouseOut = false; |
| + var box = document.getElementById('testBox'); |
| + box.addEventListener('mouseleave', function () { |
| + hasMouseLeave = true; |
|
Rick Byers
2015/03/06 16:05:37
please verify here (and below if you like) that th
Miyoung Shin(g)
2015/03/09 15:47:27
Done. Thank you for your comment.
|
| + }); |
| + box.addEventListener('mouseout', function () { |
| + hasMouseOut = true; |
| + }); |
| + if (window.testRunner) { |
| + eventSender.mouseMoveTo(1, 1); |
| + eventSender.mouseMoveTo(box.offsetLeft + 10, box.offsetTop + 10); |
| + eventSender.mouseLeave(); |
| + shouldBeTrue('hasMouseLeave'); |
| + shouldBeTrue('hasMouseOut'); |
| + finishJSTest(); |
| + } |
| +</script> |