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

Side by Side Diff: LayoutTests/accessibility/input-text-selected-range.html

Issue 1050123003: Rewrote password layout test and removed obsolete tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Renamed some more tests for consistency. Created 5 years, 8 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
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 </head>
6 <body>
7
8 <input type="text" id="input" value="Line 1">
9
10 <p id="description"></p>
11 <div id="console"></div>
12
13 <script>
14 description("This tests that text selection is reported correctly for te xt input elements.");
15
16 if (window.accessibilityController) {
17
18 var input = document.getElementById('input');
19 input.focus();
20 var inputAccessible =
21 accessibilityController.accessibleElementById('input');
22
23 // Select the entire contents.
24 input.select();
25 shouldBeZero("inputAccessible.selectionStart");
26 shouldBeEqualToNumber("inputAccessible.selectionEnd", 6);
27 shouldBeEqualToNumber("inputAccessible.selectionStartLineNumber", 0) ;
28 shouldBeEqualToNumber("inputAccessible.selectionEndLineNumber", 0);
29
30 // Select all possible text ranges.
31 for (var start = 0; start < 7; ++start) {
32 for (var end = start + 1; end < 7; ++end) {
33 input.setSelectionRange(start, end);
34 shouldBeEqualToNumber("inputAccessible.selectionStart", star t);
35 shouldBeEqualToNumber("inputAccessible.selectionEnd", end);
36 shouldBeEqualToNumber("inputAccessible.selectionStartLineNum ber", 0);
37 shouldBeEqualToNumber("inputAccessible.selectionEndLineNumbe r", 0);
38 }
39 }
40
41 }
42 </script>
43
44 </body>
45 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698