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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/mouse-cursor-change-after-image-load.html

Issue 2107043002: Schedule cursor update on URL cursor image loaded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: eae's review Created 4 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/Source/core/layout/LayoutFrame.h » ('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 <html>
3 <head>
4 <title>Cursor: should update after image loaded even when stationary</title>
5 <script src="../../resources/testharness.js"></script>
6 <script src="../../resources/testharnessreport.js"></script>
7 <style>
8 #target {
9 height: 500px;
10 width: 500px;
11 }
12 </style>
13 </head>
14 <body>
15 <div id="target"></div>
16 <script>
17 var cursorTest = async_test('Test cursor update after image loaded');
18 cursorTest.step(function() {
19 assert_not_equals(window.eventSender, undefined, 'This test requires eventSe nder.');
20
21 assert_equals(internals.getCurrentCursorInfo(), "type=Pointer hotSpot=0,0");
22
23 var target = document.getElementById('target');
24 var rect = target.getBoundingClientRect();
25 eventSender.mouseMoveTo(rect.left + 3, rect.top + 3);
26
27 // Wait for condition until timeout.
28 function waitForCondition(condition, completion) {
29 if (condition()) {
30 completion();
31 } else {
32 requestAnimationFrame(() => waitForCondition(condition, completion)) ;
33 }
34 }
35
36 function testSetCursorImage(url, expectedCursorInfo, complete) {
37 const currentCursorInfo = internals.getCurrentCursorInfo();
38 target.style.cursor = `url(${url}),auto`;
39 waitForCondition(() => internals.getCurrentCursorInfo() != currentCursor Info, cursorTest.step_func(() => {
40 assert_equals(internals.getCurrentCursorInfo(), expectedCursorInfo);
41 complete();
42 }));
43 }
44
45 testSetCursorImage('resources/greenbox.png', 'type=Custom hotSpot=0,0 image= 25x25', () => {
46 testSetCursorImage('resources/abe.png', 'type=Custom hotSpot=0,0 image=7 6x103', () => {
47 cursorTest.done();
48 })
49 });
50 });
51 </script>
52 </body>
53 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698