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

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/editing_test.extjs

Issue 2931893002: More precise use of multiline state (Closed)
Patch Set: Fix test Created 3 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Include test fixture. 5 // Include test fixture.
6 GEN_INCLUDE(['../../testing/chromevox_next_e2e_test_base.js', 6 GEN_INCLUDE(['../../testing/chromevox_next_e2e_test_base.js',
7 '../../testing/assert_additions.js']); 7 '../../testing/assert_additions.js']);
8 8
9 GEN_INCLUDE(['../../testing/mock_feedback.js']); 9 GEN_INCLUDE(['../../testing/mock_feedback.js']);
10 10
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 .call(input.setSelection.bind(input, 5, 5)) 156 .call(input.setSelection.bind(input, 5, 5))
157 .expectBraille('text2 ed', {startIndex: 5, endIndex: 5}) 157 .expectBraille('text2 ed', {startIndex: 5, endIndex: 5})
158 .expectSpeech('text2'); 158 .expectSpeech('text2');
159 159
160 mockFeedback.replay(); 160 mockFeedback.replay();
161 }); 161 });
162 }); 162 });
163 163
164 TEST_F('EditingTest', 'OneLineBreak', function() { 164 TEST_F('EditingTest', 'OneLineBreak', function() {
165 this.assertLineData(function() {/*! 165 this.assertLineData(function() {/*!
166 <div role="textbox" contenteditable>this is a<br>test</div> 166 <div role="textbox" contenteditable aria-multiline="true">
167 this is a<br>test</div>
167 */}, 168 */},
168 [ 169 [
169 {start: 0, end: 9, text: 'this is a'}, 170 {start: 0, end: 9, text: 'this is a'},
170 {start: 10, end: 14, text: 'test'} 171 {start: 10, end: 14, text: 'test'}
171 ]); 172 ]);
172 }); 173 });
173 174
174 TEST_F('EditingTest', 'TwoLineBreaks', function() { 175 TEST_F('EditingTest', 'TwoLineBreaks', function() {
175 this.assertLineData(function() {/*! 176 this.assertLineData(function() {/*!
176 <div role="textbox" contenteditable>this is a<br><br> 177 <div role="textbox" contenteditable aria-multiline="true">
177 test</div> 178 this is a<br><br>test</div>
178 */}, 179 */},
179 [ 180 [
180 {start: 0, end: 9, text: 'this is a'}, 181 {start: 0, end: 9, text: 'this is a'},
181 {start: 10, end: 10, text: ''}, 182 {start: 10, end: 10, text: ''},
182 {start: 11, end: 15, text: 'test'}, 183 {start: 11, end: 15, text: 'test'},
183 ]); 184 ]);
184 }); 185 });
185 186
186 TEST_F('EditingTest', 'InitialBreaks', function() { 187 TEST_F('EditingTest', 'InitialBreaks', function() {
187 this.assertLineData(function() {/*! 188 this.assertLineData(function() {/*!
188 <div role="textbox" contenteditable><br><br><br> 189 <div role="textbox" contenteditable aria-multiline="true"><br><br><br>
189 this is a</div> 190 this is a</div>
190 */}, 191 */},
191 [ 192 [
192 {start: 0, end: 0, text: ''}, 193 {start: 0, end: 0, text: ''},
193 {start: 1, end: 1, text: ''}, 194 {start: 1, end: 1, text: ''},
194 {start: 2, end: 2, text: ''}, 195 {start: 2, end: 2, text: ''},
195 {start: 3, end: 12, text: 'this is a'}, 196 {start: 3, end: 12, text: 'this is a'},
196 ]); 197 ]);
197 }); 198 });
198 199
199 TEST_F('EditingTest', 'SingleCharacterLine', function() { 200 TEST_F('EditingTest', 'SingleCharacterLine', function() {
200 this.assertLineData(function() {/*! 201 this.assertLineData(function() {/*!
201 <div role="textbox" contenteditable> 202 <div role="textbox" contenteditable aria-multiline="true">
David Tseng 2017/07/01 01:17:40 This is a pretty bad example to do this. The conte
202 <div>this</div><br> 203 <div>this</div><br>
203 <div><br> 204 <div><br>
204 I<br> 205 I<br>
205 can test</div></div> 206 can test</div></div>
206 */}, 207 */},
207 [ 208 [
208 {start: 0, end: 4, text: 'this'}, 209 {start: 0, end: 4, text: 'this'},
209 {start: 5, end: 5, text: ''}, 210 {start: 5, end: 5, text: ''},
210 {start: 6, end: 6, text: ''}, 211 {start: 6, end: 6, text: ''},
211 {start: 7, end: 8, text: 'I'}, 212 {start: 7, end: 8, text: 'I'},
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 assertEquals(0, e1.startOffset); 758 assertEquals(0, e1.startOffset);
758 assertEquals(2, e1.endOffset); 759 assertEquals(2, e1.endOffset);
759 760
760 // Across paragraph selection with base line on anchor. 761 // Across paragraph selection with base line on anchor.
761 e1 = new editing.EditableLine(thisIsATest, 5, hello, 2, true); 762 e1 = new editing.EditableLine(thisIsATest, 5, hello, 2, true);
762 assertEquals('is ', e1.text); 763 assertEquals('is ', e1.text);
763 assertEquals(0, e1.startOffset); 764 assertEquals(0, e1.startOffset);
764 assertEquals(3, e1.endOffset); 765 assertEquals(3, e1.endOffset);
765 }) 766 })
766 }); 767 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698