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

Side by Side Diff: LayoutTests/editing/undo/undo-deleteWord.html

Issue 484353004: Test tidying: use "escape" and "backspace" with eventSender.keyDown() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: More quoting consistency wibbles Created 6 years, 4 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> 1 <html>
2 <head> 2 <head>
3 3
4 <style> 4 <style>
5 .editing { 5 .editing {
6 border: 2px solid red; 6 border: 2px solid red;
7 } 7 }
8 .explanation { 8 .explanation {
9 border: 2px solid blue; 9 border: 2px solid blue;
10 padding: 12px; 10 padding: 12px;
11 font-size: 24px; 11 font-size: 24px;
12 margin-bottom: 24px; 12 margin-bottom: 24px;
13 } 13 }
14 .scenario { margin-bottom: 16px;} 14 .scenario { margin-bottom: 16px;}
15 .scenario:first-line { font-weight: bold; margin-bottom: 16px;} 15 .scenario:first-line { font-weight: bold; margin-bottom: 16px;}
16 </style> 16 </style>
17 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script > 17 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script >
18 18
19 <script> 19 <script>
20 20
21 function sendDeleteWordKey() 21 function sendDeleteWordKey()
22 { 22 {
23 var deleteWordModifiers; 23 var deleteWordModifiers;
24 if (navigator.userAgent.search(/\bMac OS X\b/) != -1) 24 if (navigator.userAgent.search(/\bMac OS X\b/) != -1)
25 deleteWordModifiers = ["altKey"]; 25 deleteWordModifiers = ["altKey"];
26 else 26 else
27 deleteWordModifiers = ["ctrlKey"]; 27 deleteWordModifiers = ["ctrlKey"];
28 28
29 if (window.eventSender) 29 if (window.eventSender)
30 eventSender.keyDown(String.fromCharCode(8), deleteWordModifiers); 30 eventSender.keyDown("backspace", deleteWordModifiers);
31 window.setTimeout(undoNow, 100); 31 window.setTimeout(undoNow, 100);
32 } 32 }
33 33
34 function undoNow() 34 function undoNow()
35 { 35 {
36 document.execCommand("Undo"); 36 document.execCommand("Undo");
37 37
38 if (window.testRunner) 38 if (window.testRunner)
39 testRunner.notifyDone(); 39 testRunner.notifyDone();
40 } 40 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 testRunner.waitUntilDone(); 86 testRunner.waitUntilDone();
87 } 87 }
88 88
89 var selection = window.getSelection(); 89 var selection = window.getSelection();
90 selection.collapse(document.getElementById("test"), 0); 90 selection.collapse(document.getElementById("test"), 0);
91 editingTest(); 91 editingTest();
92 </script> 92 </script>
93 93
94 </body> 94 </body>
95 </html> 95 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698