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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/keyboard-scroll-by-page.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 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../resources/js-test.js"></script> 4 <script src="../../resources/js-test.js"></script>
5 <style type="text/css"> 5 <style type="text/css">
6 ::-webkit-scrollbar { 6 ::-webkit-scrollbar {
7 width: 0px; 7 width: 0px;
8 height: 0px; 8 height: 0px;
9 } 9 }
10 10
(...skipping 15 matching lines...) Expand all
26 <div id="greenbox"></div> 26 <div id="greenbox"></div>
27 <div id="redbox"></div> 27 <div id="redbox"></div>
28 28
29 <p id="description"></p> 29 <p id="description"></p>
30 <div id="console"></div> 30 <div id="console"></div>
31 <script type="text/javascript"> 31 <script type="text/javascript">
32 32
33 function keyboardScrollPageDown() 33 function keyboardScrollPageDown()
34 { 34 {
35 if (navigator.platform.indexOf('Mac') == 0) { 35 if (navigator.platform.indexOf('Mac') == 0) {
36 eventSender.keyDown('downArrow', ["altKey"]); 36 eventSender.keyDown('ArrowDown', ["altKey"]);
37 } else { 37 } else {
38 eventSender.keyDown('pageDown'); 38 eventSender.keyDown('PageDown');
39 } 39 }
40 40
41 // see kMinFractionToStepWhenPaging = 0.875f in ScrollableArea.cpp 41 // see kMinFractionToStepWhenPaging = 0.875f in ScrollableArea.cpp
42 shouldBecomeEqual("document.scrollingElement.scrollTop >= window.innerHeight * 0.875", "true", keyboardScrollPageUp); 42 shouldBecomeEqual("document.scrollingElement.scrollTop >= window.innerHeight * 0.875", "true", keyboardScrollPageUp);
43 } 43 }
44 44
45 function keyboardScrollPageUp() 45 function keyboardScrollPageUp()
46 { 46 {
47 if (navigator.platform.indexOf('Mac') == 0) { 47 if (navigator.platform.indexOf('Mac') == 0) {
48 eventSender.keyDown('upArrow', ["altKey"]); 48 eventSender.keyDown('ArrowUp', ["altKey"]);
49 } else { 49 } else {
50 eventSender.keyDown('pageUp'); 50 eventSender.keyDown('PageUp');
51 } 51 }
52 52
53 // PageDown + PageUp goes back to 0 53 // PageDown + PageUp goes back to 0
54 shouldBecomeEqual("document.scrollingElement.scrollTop", "0", finishJSTest); 54 shouldBecomeEqual("document.scrollingElement.scrollTop", "0", finishJSTest);
55 } 55 }
56 56
57 jsTestIsAsync = true; 57 jsTestIsAsync = true;
58 58
59 function runTest() 59 function runTest()
60 { 60 {
61 if (window.eventSender) { 61 if (window.eventSender) {
62 description('This tests keyboard scrolling by pages.'); 62 description('This tests keyboard scrolling by pages.');
63 keyboardScrollPageDown(); 63 keyboardScrollPageDown();
64 } else { 64 } else {
65 debug("This test requires DumpRenderTree. Use PageUp/Down (or Alt-Up/Do wn for Mac) to validate the implementation."); 65 debug("This test requires DumpRenderTree. Use PageUp/Down (or Alt-Up/Do wn for Mac) to validate the implementation.");
66 } 66 }
67 } 67 }
68 </script> 68 </script>
69 69
70 </body> 70 </body>
71 </html> 71 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698