Chromium Code Reviews| 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(['../../../chromevox/testing/chromevox_e2e_test_base.js']); | 6 GEN_INCLUDE(['../../../chromevox/testing/chromevox_e2e_test_base.js']); |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Test fixture for cvox2.Background. | 9 * Test fixture for cvox2.Background. |
| 10 * @constructor | 10 * @constructor |
| 11 * @extends {ChromeVoxE2ETest} | 11 * @extends {ChromeVoxE2ETest} |
| 12 */ | 12 */ |
| 13 function BackgroundTest() {} | 13 function BackgroundTest() {} |
| 14 | 14 |
| 15 BackgroundTest.prototype = { | 15 BackgroundTest.prototype = { |
| 16 __proto__: ChromeVoxE2ETest.prototype, | 16 __proto__: ChromeVoxE2ETest.prototype, |
| 17 | 17 |
| 18 // This method is called without a |this| instance bound. | |
| 19 /** @override */ | |
| 20 testGenCppIncludes: function() { | |
| 21 ChromeVoxE2ETest.prototype.testGenCppIncludes.call(this); | |
| 22 GEN('#include "base/command_line.h"'); | |
| 23 GEN('#include "chromeos/chromeos_switches.h"'); | |
| 24 }, | |
| 25 | |
| 26 // This method is called without a |this| instance bound. | |
| 27 /** @override */ | |
| 28 testGenPreamble: function() { | |
| 29 GEN_BLOCK(function() {/*! | |
| 30 CommandLine* command_line = CommandLine::ForCurrentProcess(); | |
| 31 command_line->AppendSwitch(chromeos::switches::kEnableChromeVoxNext); | |
| 32 */}); | |
| 33 ChromeVoxE2ETest.prototype.testGenPreamble.call(this); | |
| 34 }, | |
|
Peter Lundblad
2014/09/23 09:06:20
This looks like boilerplate that should go into a
David Tseng
2014/09/23 17:16:31
Once we have a second consumer class of this, I'll
| |
| 35 | |
| 18 /** @override */ | 36 /** @override */ |
| 19 setUp: function() { | 37 setUp: function() { |
| 20 this.mockTts = new MockTts(); | 38 this.mockTts = new MockTts(); |
| 21 cvox.ChromeVox.tts = this.mockTts; | 39 cvox.ChromeVox.tts = this.mockTts; |
| 22 } | 40 } |
| 23 }; | 41 }; |
| 24 | 42 |
| 25 /** | 43 /** |
| 26 * Mock tts class. | 44 * Mock tts class. |
| 27 * @constructor | 45 * @constructor |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 testButton.addEventListener(chrome.automation.EventType.focus, | 103 testButton.addEventListener(chrome.automation.EventType.focus, |
| 86 function(e) { | 104 function(e) { |
| 87 var result = | 105 var result = |
| 88 cvox.ChromeVox.tts.checkIfSubstringWasSpoken('Status tray'); | 106 cvox.ChromeVox.tts.checkIfSubstringWasSpoken('Status tray'); |
| 89 testDone([result, '']); | 107 testDone([result, '']); |
| 90 }, | 108 }, |
| 91 true); | 109 true); |
| 92 testButton.focus(); | 110 testButton.focus(); |
| 93 }); | 111 }); |
| 94 }); | 112 }); |
| OLD | NEW |