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 GEN_INCLUDE(['../../testing/assert_additions.js']); | 5 GEN_INCLUDE(['../../testing/assert_additions.js']); |
6 GEN_INCLUDE(['../../testing/chromevox_next_e2e_test_base.js']); | 6 GEN_INCLUDE(['../../testing/chromevox_next_e2e_test_base.js']); |
7 | 7 |
8 /** | 8 /** |
9 * Test fixture for output.js. | 9 * Test fixture for output.js. |
10 * @constructor | 10 * @constructor |
11 * @extends {ChromeVoxNextE2ETestBase} | 11 * @extends {ChromeVoxNextE2ETestBase} |
12 */ | 12 */ |
13 function OutputE2ETest() {} | 13 function OutputE2ETest() { |
| 14 ChromeVoxNextE2ETest.call(this); |
| 15 } |
14 | 16 |
15 OutputE2ETest.prototype = { | 17 OutputE2ETest.prototype = { |
16 __proto__: ChromeVoxNextE2ETest.prototype, | 18 __proto__: ChromeVoxNextE2ETest.prototype, |
17 | 19 |
18 /** @override */ | 20 /** @override */ |
19 setUp: function() { | 21 setUp: function() { |
20 window.Dir = AutomationUtil.Dir; | 22 window.Dir = AutomationUtil.Dir; |
21 } | 23 } |
22 }; | 24 }; |
23 | 25 |
24 TEST_F('OutputE2ETest', 'RenderBasic', function() { | 26 TEST_F('OutputE2ETest', 'RenderBasic', function() { |
25 this.runWithLoadedTree('<a href="#">Click here</a>', | 27 this.runWithLoadedTree('<a href="#">Click here</a>', |
26 function(root) { | 28 function(root) { |
27 var link = root.firstChild.firstChild; | 29 var link = root.firstChild.firstChild; |
28 var range = cursors.Range.fromNode(link); | 30 var range = cursors.Range.fromNode(link); |
29 var o = new Output().withSpeechAndBraille(range, null, 'navigate'); | 31 var o = new Output().withSpeechAndBraille(range, null, 'navigate'); |
30 assertEqualsJSON({string_: 'Click here Link', 'spans_': [ | 32 assertEqualsJSON({string_: 'Click here Link', 'spans_': [ |
31 {value: 'name', start: 0, end: 10}, | 33 {value: 'name', start: 0, end: 10}, |
32 // Link earcon. | 34 // Link earcon. |
33 {value: {}, start: 11, end: 15} | 35 {value: {}, start: 11, end: 15} |
34 ]}, | 36 ]}, |
35 o.getBuffer()); | 37 o.getBuffer()); |
36 testDone(); | 38 }); |
37 }.bind(this)); | |
38 }); | 39 }); |
OLD | NEW |