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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/assert_selection.html

Issue 2105663002: [Editing][Codehealth] Rewrite user-select-all-selection.html with assert_selection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <script src="assert_selection.js"></script> 4 <script src="assert_selection.js"></script>
5 <div id="log"></div> 5 <div id="log"></div>
6 <script> 6 <script>
7 function checked_assert_selection(input, command, output) { 7 function checked_assert_selection(input, command, output) {
8 try { 8 try {
9 assert_selection(input, command, output); 9 assert_selection(input, command, output);
10 } catch (exception) { 10 } catch (exception) {
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 '<table><tbody><tr><td>foo</td></tr></tbody></table>|'); 54 '<table><tbody><tr><td>foo</td></tr></tbody></table>|');
55 assert_selection( 55 assert_selection(
56 '^<table><tr><td>foo</td></tr></table>|', 'noop', 56 '^<table><tr><td>foo</td></tr></table>|', 'noop',
57 '^<table><tbody><tr><td>foo</td></tr></tbody></table>|'); 57 '^<table><tbody><tr><td>foo</td></tr></tbody></table>|');
58 assert_selection( 58 assert_selection(
59 '|<table><tr><td>foo</td></tr></table>^', 'noop', 59 '|<table><tr><td>foo</td></tr></table>^', 'noop',
60 '|<table><tbody><tr><td>foo</td></tr></tbody></table>^'); 60 '|<table><tbody><tr><td>foo</td></tr></tbody></table>^');
61 }, 'markers around table'); 61 }, 'markers around table');
62 62
63 test(() => { 63 test(() => {
64 assert_equals(checked_assert_selection('foo', 'noop', 'baz'),
65 'You should specify caret position in "foo".');
66 }, 'no marker in input');
67
68 test(() => {
69 assert_equals(checked_assert_selection('fo|o', 'noop', 'fo|o'), 64 assert_equals(checked_assert_selection('fo|o', 'noop', 'fo|o'),
70 'no exception'); 65 'no exception');
71 }, 'no marker in output'); 66 }, 'no marker in output');
72 67
73 test(() => { 68 test(() => {
74 assert_equals(checked_assert_selection('fo|o|', 'noop', 'foo'), 69 assert_equals(checked_assert_selection('fo|o|', 'noop', 'foo'),
75 'You should have at least one focus marker "|" in "fo|o|".'); 70 'You should have at least one focus marker "|" in "fo|o|".');
76 }, 'multiple focus markers in input'); 71 }, 'multiple focus markers in input');
77 72
78 test(() => { 73 test(() => {
(...skipping 24 matching lines...) Expand all
103 test(() => { 98 test(() => {
104 assert_equals(checked_assert_selection('^|foo', 'noop', 'baz'), 99 assert_equals(checked_assert_selection('^|foo', 'noop', 'baz'),
105 'You should have focus marker and should not have anchor marker if and o nly if selection is a caret in "^|foo".'); 100 'You should have focus marker and should not have anchor marker if and o nly if selection is a caret in "^|foo".');
106 }, 'anchor == foucs in input'); 101 }, 'anchor == foucs in input');
107 102
108 test(() => { 103 test(() => {
109 assert_equals(checked_assert_selection('|foo', 'noop', 'b^|az'), 104 assert_equals(checked_assert_selection('|foo', 'noop', 'b^|az'),
110 'You should have focus marker and should not have anchor marker if and o nly if selection is a caret in "b^|az".'); 105 'You should have focus marker and should not have anchor marker if and o nly if selection is a caret in "b^|az".');
111 }, 'anchor == foucs in output'); 106 }, 'anchor == foucs in output');
112 </script> 107 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698