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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/select/listbox-selection.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 PUBLIC "-//IETF//DTD HTML//EN"> 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
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 <div id="parent"> 7 <div id="parent">
8 <select id="sl16" multiple size=5> 8 <select id="sl16" multiple size=5>
9 <option>a</option> 9 <option>a</option>
10 <option>b</option> 10 <option>b</option>
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 90
91 debug("1) Select one item with mouse (no previous selection)"); 91 debug("1) Select one item with mouse (no previous selection)");
92 mouseClickOnSelect("sl1", 0); 92 mouseClickOnSelect("sl1", 0);
93 shouldBe('selectionPattern("sl1")', '"10000"'); 93 shouldBe('selectionPattern("sl1")', '"10000"');
94 94
95 debug("2) Select one item with mouse (with previous selection)"); 95 debug("2) Select one item with mouse (with previous selection)");
96 mouseClickOnSelect("sl2", 0); 96 mouseClickOnSelect("sl2", 0);
97 shouldBe('selectionPattern("sl2")', '"10000"'); 97 shouldBe('selectionPattern("sl2")', '"10000"');
98 98
99 debug("3) Select one item with the keyboard (no previous selection)"); 99 debug("3) Select one item with the keyboard (no previous selection)");
100 keyDownOnSelect("sl3", "upArrow"); 100 keyDownOnSelect("sl3", "ArrowUp");
101 shouldBe('selectionPattern("sl3")', '"00001"'); 101 shouldBe('selectionPattern("sl3")', '"00001"');
102 102
103 debug("4) Select one item with the keyboard (with previous selection)"); 103 debug("4) Select one item with the keyboard (with previous selection)");
104 keyDownOnSelect("sl4", "downArrow"); 104 keyDownOnSelect("sl4", "ArrowDown");
105 shouldBe('selectionPattern("sl4")', '"00100"'); 105 shouldBe('selectionPattern("sl4")', '"00100"');
106 106
107 debug("5) Attempt to select an item cmd-clicking"); 107 debug("5) Attempt to select an item cmd-clicking");
108 mouseClickOnSelect("sl5", 1, "addSelectionKey"); 108 mouseClickOnSelect("sl5", 1, "addSelectionKey");
109 shouldBe('selectionPattern("sl5")', '"01000"'); 109 shouldBe('selectionPattern("sl5")', '"01000"');
110 110
111 debug("6) Attempt to select a range shift-clicking"); 111 debug("6) Attempt to select a range shift-clicking");
112 mouseClickOnSelect("sl6", 1, "rangeSelectionKey"); 112 mouseClickOnSelect("sl6", 1, "rangeSelectionKey");
113 shouldBe('selectionPattern("sl6")', '"01000"'); 113 shouldBe('selectionPattern("sl6")', '"01000"');
114 114
115 debug("7) Attempt to select a range with the keyboard"); 115 debug("7) Attempt to select a range with the keyboard");
116 keyDownOnSelect("sl7", "downArrow", "rangeSelectionKey"); 116 keyDownOnSelect("sl7", "ArrowDown", "rangeSelectionKey");
117 shouldBe('selectionPattern("sl7")', '"00100"'); 117 shouldBe('selectionPattern("sl7")', '"00100"');
118 118
119 // Multiple selection tests 119 // Multiple selection tests
120 120
121 debug("8) Select one item with mouse (no previous selection)"); 121 debug("8) Select one item with mouse (no previous selection)");
122 mouseClickOnSelect("sl8", 0); 122 mouseClickOnSelect("sl8", 0);
123 shouldBe('selectionPattern("sl8")', '"10000"'); 123 shouldBe('selectionPattern("sl8")', '"10000"');
124 124
125 debug("9) Select one item with mouse (with previous selection)"); 125 debug("9) Select one item with mouse (with previous selection)");
126 mouseClickOnSelect("sl9", 0); 126 mouseClickOnSelect("sl9", 0);
127 shouldBe('selectionPattern("sl9")', '"10000"'); 127 shouldBe('selectionPattern("sl9")', '"10000"');
128 128
129 debug("10) Select one item with the keyboard (no previous selection)"); 129 debug("10) Select one item with the keyboard (no previous selection)");
130 keyDownOnSelect("sl10", "upArrow"); 130 keyDownOnSelect("sl10", "ArrowUp");
131 shouldBe('selectionPattern("sl10")', '"00001"'); 131 shouldBe('selectionPattern("sl10")', '"00001"');
132 132
133 debug("11) Select one item with the keyboard (with previous selection)"); 133 debug("11) Select one item with the keyboard (with previous selection)");
134 keyDownOnSelect("sl11", "downArrow"); 134 keyDownOnSelect("sl11", "ArrowDown");
135 shouldBe('selectionPattern("sl11")', '"00100"'); 135 shouldBe('selectionPattern("sl11")', '"00100"');
136 136
137 debug("12) Select an item cmd-clicking"); 137 debug("12) Select an item cmd-clicking");
138 mouseClickOnSelect("sl12", 1, "addSelectionKey"); 138 mouseClickOnSelect("sl12", 1, "addSelectionKey");
139 shouldBe('selectionPattern("sl12")', '"01100"'); 139 shouldBe('selectionPattern("sl12")', '"01100"');
140 140
141 debug("13) Select a range shift-clicking"); 141 debug("13) Select a range shift-clicking");
142 mouseClickOnSelect("sl13", 3, "rangeSelectionKey"); 142 mouseClickOnSelect("sl13", 3, "rangeSelectionKey");
143 shouldBe('selectionPattern("sl13")', '"11110"'); 143 shouldBe('selectionPattern("sl13")', '"11110"');
144 144
145 debug("14) Select a range with the keyboard"); 145 debug("14) Select a range with the keyboard");
146 keyDownOnSelect("sl14", "downArrow", "rangeSelectionKey"); 146 keyDownOnSelect("sl14", "ArrowDown", "rangeSelectionKey");
147 shouldBe('selectionPattern("sl14")', '"01100"'); 147 shouldBe('selectionPattern("sl14")', '"01100"');
148 148
149 debug("15) Drag upside-down"); 149 debug("15) Drag upside-down");
150 mouseMoveToOption("sl15", 1); 150 mouseMoveToOption("sl15", 1);
151 eventSender.dragMode = false; // Avoid event delay in eventSender. 151 eventSender.dragMode = false; // Avoid event delay in eventSender.
152 eventSender.mouseDown(0); 152 eventSender.mouseDown(0);
153 shouldBeEqualToString('selectionPattern("sl15")', "01000"); 153 shouldBeEqualToString('selectionPattern("sl15")', "01000");
154 shouldBeEqualToString('mouseMoveToOption("sl15", 3); selectionPattern("sl15")', "01110"); 154 shouldBeEqualToString('mouseMoveToOption("sl15", 3); selectionPattern("sl15")', "01110");
155 shouldBeEqualToString('mouseMoveToOption("sl15", 2); selectionPattern("sl15")', "01100"); 155 shouldBeEqualToString('mouseMoveToOption("sl15", 2); selectionPattern("sl15")', "01100");
156 eventSender.mouseUp(0); 156 eventSender.mouseUp(0);
157 // activeSelectionEnd is the third OPTION. upArrow should select the previous 157 // activeSelectionEnd is the third OPTION. ArrowUp should select the previous
158 // one of the third OPTION. Adding new OPTION shouldn't clear 158 // one of the third OPTION. Adding new OPTION shouldn't clear
159 // activeSelectionEnd. 159 // activeSelectionEnd.
160 shouldBeEqualToString('sl15.add(new Option("a")); eventSender.keyDown("upArrow") ; selectionPattern("sl15")', "010000"); 160 shouldBeEqualToString('sl15.add(new Option("a")); eventSender.keyDown("ArrowUp") ; selectionPattern("sl15")', "010000");
161 161
162 debug("16) Active-selection after type-ahead"); 162 debug("16) Active-selection after type-ahead");
163 shouldBeEqualToString("mouseClickOnSelect('sl16', 1); selectionPattern('sl16')", "01000"); 163 shouldBeEqualToString("mouseClickOnSelect('sl16', 1); selectionPattern('sl16')", "01000");
164 shouldBeEqualToString("keyDownOnSelect('sl16', 'e'); selectionPattern('sl16')", "00001"); 164 shouldBeEqualToString("keyDownOnSelect('sl16', 'e'); selectionPattern('sl16')", "00001");
165 shouldBeEqualToString("keyDownOnSelect('sl16', 'upArrow', 'rangeSelectionKey'); selectionPattern('sl16')", "00011"); 165 shouldBeEqualToString("keyDownOnSelect('sl16', 'ArrowUp', 'rangeSelectionKey'); selectionPattern('sl16')", "00011");
166 166
167 document.getElementById("parent").remove(); 167 document.getElementById("parent").remove();
168 </script> 168 </script>
169 </body> 169 </body>
170 </html> 170 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698