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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/events/event-sender-mouseleave-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <style>
3 #testBox {
4 background: blue;
5 top: 100px;
6 left: 100px;
7 width: 100px;
8 height: 100px;
9 position: absolute;
10 }
11 </style>
12 <div id="testBox">
13 </div>
14 <p id="description">
15 </p>
16 <script src="../../resources/js-test.js"></script>
17 <script>
18 window.jsTestIsAsync = true;
19
20 description('Test that a mouse leave event is triggered when the OS tells us the mouse has left without changing position.');
21 var hasMouseLeave = false;
22 var hasMouseOut = false;
23 var box = document.getElementById('testBox');
24 var lastMouseX = 0;
25 var lastMouseY = 0;
26 box.addEventListener('mouseleave', function (e) {
27 hasMouseLeave = true;
28 lastMouseX = e.clientX;
29 lastMouseY = e.clientY;
30 });
31 box.addEventListener('mouseout', function () {
32 hasMouseOut = true;
33 });
34 if (window.testRunner) {
35 eventSender.mouseMoveTo(1, 1);
36 eventSender.mouseMoveTo(box.offsetLeft + 10, box.offsetTop + 10);
37 eventSender.mouseLeave();
38 shouldBeTrue('hasMouseLeave');
39 shouldBeTrue('hasMouseOut');
40 shouldBe('box.offsetLeft + 10', 'lastMouseX');
41 shouldBe('box.offsetTop + 10', 'lastMouseY');
42 finishJSTest();
43 }
44 </script>
OLDNEW
« 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