OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_unittest_base.js']); | 6 GEN_INCLUDE(['../testing/chromevox_unittest_base.js']); |
7 | 7 |
8 /** | 8 /** |
9 * Test fixture. | 9 * Test fixture. |
10 * @constructor | 10 * @constructor |
(...skipping 30 matching lines...) Expand all Loading... |
41 assertEquals(2, shadow.getLineIndex(5)); | 41 assertEquals(2, shadow.getLineIndex(5)); |
42 assertEquals(2, shadow.getLineIndex(8)); | 42 assertEquals(2, shadow.getLineIndex(8)); |
43 assertEquals(3, shadow.getLineIndex(9)); | 43 assertEquals(3, shadow.getLineIndex(9)); |
44 assertEquals(4, shadow.getLineIndex(10)); | 44 assertEquals(4, shadow.getLineIndex(10)); |
45 assertEquals(4, shadow.getLineIndex(14)); | 45 assertEquals(4, shadow.getLineIndex(14)); |
46 }); | 46 }); |
47 | 47 |
48 /** | 48 /** |
49 * Test the get line of a multiline textarea with wrapping instead of | 49 * Test the get line of a multiline textarea with wrapping instead of |
50 * explicit newlines. | 50 * explicit newlines. |
51 * Test disabled due to not being reliable if font size changes. | |
52 * See https://codereview.chromium.org/549303004/ | |
53 */ | 51 */ |
54 TEST_F('CvoxShadowUnitTest', 'DISABLED_MultilineWrap', function() { | 52 TEST_F('CvoxShadowUnitTest', 'MultilineWrap', function() { |
55 this.loadDoc(function() {/*! | 53 this.loadDoc(function() {/*! |
56 <div><textarea id="area" | 54 <div><textarea id="area" |
57 cols=4 rows=20>One two thr fou fiv six sev eig</textarea> | 55 cols=4 rows=20>One two thr fou fiv six sev eig</textarea> |
58 </div> */}); | 56 </div> */}); |
59 | 57 |
60 var area = $('area'); | 58 var area = $('area'); |
61 | 59 |
62 var shadow = new cvox.EditableTextAreaShadow(); | 60 var shadow = new cvox.EditableTextAreaShadow(); |
63 shadow.update(area); | 61 shadow.update(area); |
64 for (var i = 0; i < 32; i++) { | 62 for (var i = 0; i < 32; i++) { |
65 assertEquals(Math.floor(i / 4), shadow.getLineIndex(i)); | 63 assertEquals(Math.floor(i / 4), shadow.getLineIndex(i)); |
66 } | 64 } |
67 }); | 65 }); |
OLD | NEW |