| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 /** | |
| 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() {} | |
| 13 | |
| 14 ChromeVoxE2ETest.prototype = { | |
| 15 __proto__: testing.Test.prototype, | |
| 16 | |
| 17 /** | |
| 18 * @override | |
| 19 * No UI in the background context. | |
| 20 */ | |
| 21 runAccessibilityChecks: false, | |
| 22 | |
| 23 /** @override */ | |
| 24 isAsync: true, | |
| 25 | |
| 26 /** @override */ | |
| 27 browsePreload: null, | |
| 28 | |
| 29 /** @override */ | |
| 30 testGenCppIncludes: function() { | |
| 31 GEN_BLOCK(function() {/*! | |
| 32 #include "ash/accessibility_delegate.h" | |
| 33 #include "base/bind.h" | |
| 34 #include "base/callback.h" | |
| 35 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | |
| 36 #include "chrome/common/extensions/extension_constants.h" | |
| 37 */}); | |
| 38 }, | |
| 39 | |
| 40 /** @override */ | |
| 41 testGenPreamble: function() { | |
| 42 GEN_BLOCK(function() {/*! | |
| 43 if (chromeos::AccessibilityManager::Get()->IsSpokenFeedbackEnabled()) { | |
| 44 chromeos::AccessibilityManager::Get()->EnableSpokenFeedback(false, | |
| 45 ash::A11Y_NOTIFICATION_NONE); | |
| 46 } | |
| 47 | |
| 48 base::Closure load_cb = | |
| 49 base::Bind(&chromeos::AccessibilityManager::EnableSpokenFeedback, | |
| 50 base::Unretained(chromeos::AccessibilityManager::Get()), | |
| 51 true, | |
| 52 ash::A11Y_NOTIFICATION_NONE); | |
| 53 WaitForExtension(extension_misc::kChromeVoxExtensionId, load_cb); | |
| 54 */}); | |
| 55 } | |
| 56 }; | |
| 57 | |
| 58 /** | |
| 59 * Similar to |TEST_F|. Generates a test for the given |testFixture|, | |
| 60 * |testName|, and |testFunction|. | |
| 61 * Used this variant when an |isAsync| fixture wants to temporarily mix in an | |
| 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 |