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

Side by Side Diff: LayoutTests/fast/forms/input-text-option-delete.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 <input id="input" type="text" value="word another"> 1 <input id="input" type="text" value="word another">
2 <p>Tests option-deleting a word. If the test succeeds, the word "word" should en d up with a space after it.</p> 2 <p>Tests option-deleting a word. If the test succeeds, the word "word" should en d up with a space after it.</p>
3 <script> 3 <script>
4 4
5 function sendDeleteWordKey() 5 function sendDeleteWordKey()
6 { 6 {
7 var deleteWordModifiers; 7 var deleteWordModifiers;
8 if (navigator.userAgent.search(/\bMac OS X\b/) != -1) 8 if (navigator.userAgent.search(/\bMac OS X\b/) != -1)
9 deleteWordModifiers = ["altKey"]; 9 deleteWordModifiers = ["altKey"];
10 else 10 else
11 deleteWordModifiers = ["ctrlKey"]; 11 deleteWordModifiers = ["ctrlKey"];
12 if (window.eventSender) 12 if (window.eventSender)
13 eventSender.keyDown(String.fromCharCode(8), deleteWordModifiers); 13 eventSender.keyDown("backspace", deleteWordModifiers);
14 } 14 }
15 15
16 var input = document.getElementById("input"); 16 var input = document.getElementById("input");
17 input.focus(); 17 input.focus();
18 input.setSelectionRange(12, 12); 18 input.setSelectionRange(12, 12);
19 sendDeleteWordKey(); 19 sendDeleteWordKey();
20 </script> 20 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698