| 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/ |
| 51 */ | 53 */ |
| 52 TEST_F('CvoxShadowUnitTest', 'MultilineWrap', function() { | 54 TEST_F('CvoxShadowUnitTest', 'DISABLED_MultilineWrap', function() { |
| 53 this.loadDoc(function() {/*! | 55 this.loadDoc(function() {/*! |
| 54 <div><textarea id="area" | 56 <div><textarea id="area" |
| 55 cols=4 rows=20>One two thr fou fiv six sev eig</textarea> | 57 cols=4 rows=20>One two thr fou fiv six sev eig</textarea> |
| 56 </div> */}); | 58 </div> */}); |
| 57 | 59 |
| 58 var area = $('area'); | 60 var area = $('area'); |
| 59 | 61 |
| 60 var shadow = new cvox.EditableTextAreaShadow(); | 62 var shadow = new cvox.EditableTextAreaShadow(); |
| 61 shadow.update(area); | 63 shadow.update(area); |
| 62 for (var i = 0; i < 32; i++) { | 64 for (var i = 0; i < 32; i++) { |
| 63 assertEquals(Math.floor(i / 4), shadow.getLineIndex(i)); | 65 assertEquals(Math.floor(i / 4), shadow.getLineIndex(i)); |
| 64 } | 66 } |
| 65 }); | 67 }); |
| OLD | NEW |