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