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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/layout-change-should-fire-mouseover.html

Issue 2956023004: Add a flag to update hover effect when a layout is changed (Closed)
Patch Set: add hover flag Created 3 years, 5 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 | third_party/WebKit/LayoutTests/fast/events/mouse-cursor-change-after-layout.html » ('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 <script src='../../resources/testharness.js'></script>
3 <script src='../../resources/testharnessreport.js'></script>
4 <style type="text/css">
5 #blue {
6 background-color: rgb(0, 0, 255);
7 position: absolute;
8 left: 75px;
9 top: 75px;
10 height: 100px;
11 width: 100px;
12 }
13 #blue:hover {
14 background-color: rgb(255, 255, 0);
15 }
16 </style>
17
18 <body onload="loaded();">
19
20 <script type="text/javascript">
21 var eventList = [];
22 var x = 100;
23 var y = 100;
24
25 function addBlue() {
26 document.body.innerHTML += '<div id="blue"></div>';
27 var blue = document.getElementById("blue");
28 var events = ['mouseover', 'mousemove', 'mouseout', 'mouseenter', 'mouseleav e'];
29 events.forEach(function (event) {
30 blue.addEventListener(event, validMouseEventsResult);
31 });
32 }
33
34 function loaded() {
35 document.addEventListener('click', addBlue);
36 }
37
38 function validMouseEventsResult(event) {
39 eventList.push(event.type);
40 testMouseOver.step(function () {
41 assert_equals(event.target.id, "blue");
42 assert_equals(getComputedStyle(event.target).backgroundColor, "rgb(255, 255, 0)");
43 });
44 }
45
46 function callbackValidMouseOver() {
47 testMouseOver.step(function () {
48 var result = eventList.join();
49 assert_true(result == 'mouseover,mouseenter' || result == 'mouseenter,mo useover');
Navid Zolghadr 2017/07/06 15:26:44 Why do we check for both ordering? Aren't we alway
lanwei 2017/07/11 21:02:19 Acknowledged.
50 });
51 testMouseOver.done();
52 }
53
54 function testMouseOverAddElement() {
55 if (window.chrome && chrome.gpuBenchmarking) {
56 var pointerActions =
57 [{source: "mouse",
58 actions: [
59 { name: "pointerDown", x: x, y: y },
60 { name: "pointerUp" },
61 { name: 'pause', duration: 0.1 }]}];
62 chrome.gpuBenchmarking.pointerActionSequence(pointerActions, callbackVal idMouseOver);
63 }
64 }
65
66 var testMouseOver = async_test('Tests that the mouseover event is fired and the element has a hover effect when the element underneath the mouse cursor is chang ed.');
67 testMouseOverAddElement();
68
69 </script>
70 </body>
71
72
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/events/mouse-cursor-change-after-layout.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698