Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Unified Diff: LayoutTests/fast/events/event-sender-mouseleave.html

Issue 930803002: Add test case for mouseleave events within window bounds (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/events/event-sender-mouseleave-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c6f4da665e0ce6e49d5b3e048bce1e6d08dee7a0
--- /dev/null
+++ b/LayoutTests/fast/events/event-sender-mouseleave.html
@@ -0,0 +1,44 @@
+<!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 when the OS tells us the mouse has left without changing position.');
+ var hasMouseLeave = false;
+ var hasMouseOut = false;
+ var box = document.getElementById('testBox');
+ var lastMouseX = 0;
+ var lastMouseY = 0;
+ box.addEventListener('mouseleave', function (e) {
+ hasMouseLeave = true;
+ lastMouseX = e.clientX;
+ lastMouseY = e.clientY;
+ });
+ 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');
+ shouldBe('box.offsetLeft + 10', 'lastMouseX');
+ shouldBe('box.offsetTop + 10', 'lastMouseY');
+ finishJSTest();
+ }
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/events/event-sender-mouseleave-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698