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 /** |
6 GEN_INCLUDE(['../../../chromevox/testing/chromevox_unittest_base.js']); | 6 * Base test fixture for ChromeVox end to end tests. |
| 7 * |
| 8 * These tests run against production ChromeVox inside of the extension's |
| 9 * background page context. |
| 10 * @constructor |
| 11 */ |
| 12 function ChromeVoxE2ETest() {} |
7 | 13 |
8 /** | 14 ChromeVoxE2ETest.prototype = { |
9 * Test fixture for cvox2.Background. | 15 __proto__: testing.Test.prototype, |
10 * @constructor | |
11 * @extends {ChromeVoxUnitTestBase} | |
12 */ | |
13 function BackgroundTest() {} | |
14 | 16 |
15 BackgroundTest.prototype = { | 17 /** |
16 __proto__: ChromeVoxUnitTestBase.prototype, | 18 * @override |
| 19 * No UI in the background context. |
| 20 */ |
| 21 runAccessibilityChecks: false, |
| 22 |
| 23 /** @override */ |
| 24 isAsync: true, |
17 | 25 |
18 /** @override */ | 26 /** @override */ |
19 browsePreload: null, | 27 browsePreload: null, |
20 | 28 |
21 /** @override */ | 29 /** @override */ |
22 testGenCppIncludes: function() { | 30 testGenCppIncludes: function() { |
23 GEN_BLOCK(function() {/*! | 31 GEN_BLOCK(function() {/*! |
24 #include "ash/accessibility_delegate.h" | 32 #include "ash/accessibility_delegate.h" |
25 #include "base/bind.h" | 33 #include "base/bind.h" |
26 #include "base/callback.h" | 34 #include "base/callback.h" |
(...skipping 13 matching lines...) Expand all Loading... |
40 base::Closure load_cb = | 48 base::Closure load_cb = |
41 base::Bind(&chromeos::AccessibilityManager::EnableSpokenFeedback, | 49 base::Bind(&chromeos::AccessibilityManager::EnableSpokenFeedback, |
42 base::Unretained(chromeos::AccessibilityManager::Get()), | 50 base::Unretained(chromeos::AccessibilityManager::Get()), |
43 true, | 51 true, |
44 ash::A11Y_NOTIFICATION_NONE); | 52 ash::A11Y_NOTIFICATION_NONE); |
45 WaitForExtension(extension_misc::kChromeVoxExtensionId, load_cb); | 53 WaitForExtension(extension_misc::kChromeVoxExtensionId, load_cb); |
46 */}); | 54 */}); |
47 } | 55 } |
48 }; | 56 }; |
49 | 57 |
50 /** Tests ChromeVox classic is in this context. */ | 58 /** |
51 TEST_F('BackgroundTest', 'ClassicNamespaces', function() { | 59 * Similar to |TEST_F|. Generates a test for the given |testFixture|, |
52 assertEquals('object', typeof(cvox)); | 60 * |testName|, and |testFunction|. |
53 assertEquals('function', typeof(cvox.ChromeVoxBackground)); | 61 * Used this variant when an |isAsync| fixture wants to temporarily mix in an |
54 }); | 62 * sync test. |
| 63 * @param {string} testFixture Fixture name. |
| 64 * @param {string} testName Test name. |
| 65 * @param {function} testFunction The test impl. |
| 66 */ |
| 67 function SYNC_TEST_F(testFixture, testName, testFunction) { |
| 68 var wrappedTestFunction = function() { |
| 69 testFunction(); |
| 70 testDone([true, '']); |
| 71 }; |
| 72 TEST_F(testFixture, testName, wrappedTestFunction); |
| 73 } |
OLD | NEW |