Chromium Code Reviews| OLD | NEW |
|---|---|
| (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.'); | |
|
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.
| |
| 21 var hasMouseLeave = false; | |
| 22 var hasMouseOut = false; | |
| 23 var box = document.getElementById('testBox'); | |
| 24 box.addEventListener('mouseleave', function () { | |
| 25 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.
| |
| 26 }); | |
| 27 box.addEventListener('mouseout', function () { | |
| 28 hasMouseOut = true; | |
| 29 }); | |
| 30 if (window.testRunner) { | |
| 31 eventSender.mouseMoveTo(1, 1); | |
| 32 eventSender.mouseMoveTo(box.offsetLeft + 10, box.offsetTop + 10); | |
| 33 eventSender.mouseLeave(); | |
| 34 shouldBeTrue('hasMouseLeave'); | |
| 35 shouldBeTrue('hasMouseOut'); | |
| 36 finishJSTest(); | |
| 37 } | |
| 38 </script> | |
| OLD | NEW |