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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/node-event-anchor-lock.html

Issue 2100243002: Remove non-standardize key code names from event_sender. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix inspector tests that were missed by sed 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
OLDNEW
1 <html><body> 1 <html><body>
2 This test does the following:</br> 2 This test does the following:</br>
3 1. Navigate to an anchor link. WebKit will ensure that the anchor remains visib le as other objects load around it and scripts execute.</br> 3 1. Navigate to an anchor link. WebKit will ensure that the anchor remains visib le as other objects load around it and scripts execute.</br>
4 2. The div containing the anchor link will be scrolled via PageDown. This simul ated user action should stop us locking the screen to where the anchor is.</br> 4 2. The div containing the anchor link will be scrolled via PageDown. This simul ated user action should stop us locking the screen to where the anchor is.</br>
5 3. Force a repaint. If the lock to the anchor was properly released, the scroll caused by the PageDown will not be reverted and parentDiv.scrollTop will be grea ter than 600px (the offset of the anchor). If we return to the anchor, the test has failed.</br> 5 3. Force a repaint. If the lock to the anchor was properly released, the scroll caused by the PageDown will not be reverted and parentDiv.scrollTop will be grea ter than 600px (the offset of the anchor). If we return to the anchor, the test has failed.</br>
6 <a id="startLink" href="#anchor">Go to anchor</a> 6 <a id="startLink" href="#anchor">Go to anchor</a>
7 <div id="console"></div> 7 <div id="console"></div>
8 <div id="parentDiv" style="width:500; height:300; overflow:auto"> 8 <div id="parentDiv" style="width:500; height:300; overflow:auto">
9 <div style="height: 600px"></div> 9 <div style="height: 600px"></div>
10 <a id="anchor"></a> 10 <a id="anchor"></a>
(...skipping 14 matching lines...) Expand all
25 // Lock to the anchor inside the div 25 // Lock to the anchor inside the div
26 var target = document.getElementById("startLink"); 26 var target = document.getElementById("startLink");
27 eventSender.mouseMoveTo(target.offsetLeft + 2, target.offsetTop + 2); 27 eventSender.mouseMoveTo(target.offsetLeft + 2, target.offsetTop + 2);
28 eventSender.mouseDown(); 28 eventSender.mouseDown();
29 eventSender.mouseUp(); 29 eventSender.mouseUp();
30 30
31 // Perform a page down to be handled by div, should release anchor lock 31 // Perform a page down to be handled by div, should release anchor lock
32 var divInfo = document.getElementById("parentDiv"); 32 var divInfo = document.getElementById("parentDiv");
33 eventSender.mouseMoveTo(divInfo.offsetLeft + 2, divInfo.offsetTop + 2); 33 eventSender.mouseMoveTo(divInfo.offsetLeft + 2, divInfo.offsetTop + 2);
34 eventSender.mouseDown(); 34 eventSender.mouseDown();
35 eventSender.keyDown("pageDown"); 35 eventSender.keyDown("PageDown");
36 } 36 }
37 37
38 // Force layout. If the scrollbar gets reset during layout, the test has failed 38 // Force layout. If the scrollbar gets reset during layout, the test has failed
39 document.getElementById("startLink").offsetHeight += 1; 39 document.getElementById("startLink").offsetHeight += 1;
40 40
41 var scrollTop = document.getElementById("parentDiv").scrollTop; 41 var scrollTop = document.getElementById("parentDiv").scrollTop;
42 var line = document.createElement('div'); 42 var line = document.createElement('div');
43 if (scrollTop > 600) 43 if (scrollTop > 600)
44 line.appendChild(document.createTextNode("PASS: scrollTop is greater than 60 0px")); 44 line.appendChild(document.createTextNode("PASS: scrollTop is greater than 60 0px"));
45 else 45 else
46 line.appendChild(document.createTextNode("FAIL: scrollTop is " + scrollTop+ "px, but should be more than 600px")); 46 line.appendChild(document.createTextNode("FAIL: scrollTop is " + scrollTop+ "px, but should be more than 600px"));
47 document.getElementById('console').appendChild(line); 47 document.getElementById('console').appendChild(line);
48 48
49 if (window.testRunner) 49 if (window.testRunner)
50 testRunner.notifyDone(); 50 testRunner.notifyDone();
51 51
52 </script></body></html> 52 </script></body></html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698