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

Side by Side Diff: LayoutTests/fast/events/mouse-cursor-style-change-iframe.html

Issue 1121433003: Fix mouse cursor update timer to be page-global instead of per-frame (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/events/mouse-cursor-style-change-iframe-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 <script src="../../resources/js-test.js"></script>
3 <style type="text/css">
4 #container {
5 padding: 30px;
6 cursor: pointer;
7 border: 1px solid blue;
8 }
9 .wait {
10 cursor: wait !important;
11 }
12 iframe {
13 width: 300px;
14 }
15 </style>
16 </head>
17 <body>
18 <p id="description"></p>
19 <div id="container">
20 <iframe id=frame srcdoc="<body style='height: 500px; cursor: text;'></body>" ></iframe>
bokan 2015/05/01 15:55:56 Nit: frame -> "frame"
Rick Byers 2015/05/01 17:26:47 Done.
21 </div>
22 <div id="console"></div>
23 <script>
24 var CURSOR_UPDATE_DELAY = 50;
bokan 2015/05/01 15:55:56 It looks like we need this delay because the curso
Rick Byers 2015/05/01 17:26:47 Done.
25
26 description("Test that a cursor change that occurs due only to a style chang e correctly considers iframes.");
27
28 if (!window.eventSender) {
29 testFailed('This test requires DumpRenderTree');
30 }
31
32 if (window.testRunner) {
33 testRunner.dumpAsText();
34 testRunner.waitUntilDone();
35 window.jsTestIsAsync = true;
36 }
37
38 var container = document.getElementById('container');
39
40 var y;
41 var frame;
42
43 if (window.eventSender) {
44 debug('Mouse moved to cursor changing div');
45 eventSender.mouseMoveTo(100, container.offsetTop + 5);
46 debug('Cursor Info: ' + window.internals.getCurrentCursorInfo(document)) ;
47 shouldBeEqualToString('window.internals.getCurrentCursorInfo(document)', 'type=Hand hotSpot=0,0');
48
49 debug('Changing cursor style');
50 container.classList.add('wait');
51 setTimeout(function() {
52 shouldBeEqualToString('window.internals.getCurrentCursorInfo(documen t)', 'type=Wait hotSpot=0,0');
53 debug('');
54
55 debug('Now move mouse onto iframe above cursor changing div');
56 frame = document.getElementById('frame');
57 y = frame.offsetTop + 10;
58 eventSender.mouseMoveTo(100, y);
59 eventSender.mouseMoveTo(101, y);
bokan 2015/05/01 15:55:56 Why the 1px move?
Rick Byers 2015/05/01 17:26:47 Whoops, that was leftover from trying to diagnose
60 shouldBe('document.elementFromPoint(100, y)', 'frame');
61 shouldBeTrue('document.elementsFromPoint(100, y).indexOf(container) > 0');
62 shouldBeEqualToString('window.internals.getCurrentCursorInfo(documen t)', 'type=IBeam hotSpot=0,0');
63 debug('');
64
65 debug('Changing cursor style of the background should not affect the cursor as it sits over the iframe');
66 container.classList.remove('wait');
67 setTimeout(function() {
68 shouldBeEqualToString('window.internals.getCurrentCursorInfo(doc ument)', 'type=IBeam hotSpot=0,0');
69 finishJSTest();
70 }, CURSOR_UPDATE_DELAY);
71 }, CURSOR_UPDATE_DELAY);
72
73 } else {
74 function toggleCursorInMainFrame() {
75 container.classList.toggle('cursor');
76 requestAnimationFrame(toggleCursorInMainFrame);
77 }
78 requestAnimationFrame(toggleCursorInMainFrame);
79 }
80 </script>
81 </body>
82 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/events/mouse-cursor-style-change-iframe-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698