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

Side by Side Diff: third_party/WebKit/LayoutTests/accessibility/contenteditable-notifications.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 </head> 5 </head>
6 <body> 6 <body>
7 7
8 <div id="textbox" contentEditable="true">First<p>Second</p></div> 8 <div id="textbox" contentEditable="true">First<p>Second</p></div>
9 9
10 <div id="console"></div> 10 <div id="console"></div>
11 <script> 11 <script>
12 description("This test ensures that moving the cursor in a contentEditable sends a selected text change notification, and typing in a contentEditable sends both a value changed and selected text changed notification - both on the root eleme nt that's marked as contentEditable."); 12 description("This test ensures that moving the cursor in a contentEditable sends a selected text change notification, and typing in a contentEditable sends both a value changed and selected text changed notification - both on the root eleme nt that's marked as contentEditable.");
13 window.jsTestIsAsync = true; 13 window.jsTestIsAsync = true;
14 14
15 if (window.testRunner && window.accessibilityController) { 15 if (window.testRunner && window.accessibilityController) {
16 testRunner.dumpAsText(); 16 testRunner.dumpAsText();
17 17
18 // Focus the contenteditable text box and move the cursor to the end. 18 // Focus the contenteditable text box and move the cursor to the end.
19 var textbox = document.getElementById("textbox"); 19 var textbox = document.getElementById("textbox");
20 textbox.focus(); 20 textbox.focus();
21 eventSender.keyDown("downArrow", []); 21 eventSender.keyDown("ArrowDown", []);
22 eventSender.keyDown("downArrow", []); 22 eventSender.keyDown("ArrowDown", []);
23 23
24 var axTextBox = accessibilityController.focusedElement; 24 var axTextBox = accessibilityController.focusedElement;
25 25
26 var valueChangedCount = 0; 26 var valueChangedCount = 0;
27 var selectedTextChangedCount = 0; 27 var selectedTextChangedCount = 0;
28 28
29 // Defer the main part of the test so that the notification listener 29 // Defer the main part of the test so that the notification listener
30 // doesn't catch any notifications still in the queue from loading the 30 // doesn't catch any notifications still in the queue from loading the
31 // page and initially setting focus. 31 // page and initially setting focus.
32 window.setTimeout(function() { 32 window.setTimeout(function() {
33 axTextBox.addNotificationListener(function(notification) { 33 axTextBox.addNotificationListener(function(notification) {
34 testPassed("Got notification: " + notification); 34 testPassed("Got notification: " + notification);
35 35
36 if (notification == "ValueChanged") 36 if (notification == "ValueChanged")
37 valueChangedCount++; 37 valueChangedCount++;
38 else if (notification == "SelectedTextChanged") 38 else if (notification == "SelectedTextChanged")
39 selectedTextChangedCount++; 39 selectedTextChangedCount++;
40 40
41 if (valueChangedCount == 8 && selectedTextChangedCount == 6) { 41 if (valueChangedCount == 8 && selectedTextChangedCount == 6) {
42 textbox.style.display = "none"; 42 textbox.style.display = "none";
43 finishJSTest(); 43 finishJSTest();
44 } 44 }
45 }); 45 });
46 46
47 eventSender.keyDown("leftArrow", []); 47 eventSender.keyDown("ArrowLeft", []);
48 eventSender.keyDown("leftArrow", []); 48 eventSender.keyDown("ArrowLeft", []);
49 eventSender.keyDown("w", []); 49 eventSender.keyDown("w", []);
50 eventSender.keyDown("x", []); 50 eventSender.keyDown("x", []);
51 eventSender.keyDown("y", []); 51 eventSender.keyDown("y", []);
52 eventSender.keyDown("z", []); 52 eventSender.keyDown("z", []);
53 53
54 }, 0); 54 }, 0);
55 } 55 }
56 56
57 </script> 57 </script>
58 58
59 </body> 59 </body>
60 </html> 60 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698