Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(523)

Unified Diff: chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc

Issue 261013009: Add test of ChromeVox in guest mode so we can't accidentally break it again. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Parametrized the test Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
diff --git a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
index b2bd8e3942ac74bca8a673fc32a1e53c4c8b06dd..c37c270c798d65dd1af42c7b8379bd2b91d2d624 100644
--- a/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
+++ b/chrome/browser/chromeos/accessibility/spoken_feedback_browsertest.cc
@@ -21,6 +21,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
#include "chrome/browser/ui/browser_window.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/testing_profile.h"
#include "chrome/test/base/ui_test_utils.h"
@@ -39,7 +40,14 @@ namespace chromeos {
// Spoken feedback tests in a normal browser window.
//
-class SpokenFeedbackTest : public InProcessBrowserTest {
+enum SpokenFeedbackTestVariant {
+ kTestAsNormalUser,
+ kTestAsGuestUser
+};
+
+class SpokenFeedbackTest
+ : public InProcessBrowserTest,
+ public ::testing::WithParamInterface<SpokenFeedbackTestVariant> {
protected:
SpokenFeedbackTest() {}
virtual ~SpokenFeedbackTest() {}
@@ -52,12 +60,29 @@ class SpokenFeedbackTest : public InProcessBrowserTest {
AccessibilityManager::SetBrailleControllerForTest(NULL);
}
+ virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
+ if (GetParam() == kTestAsGuestUser) {
+ command_line->AppendSwitch(chromeos::switches::kGuestSession);
+ command_line->AppendSwitch(::switches::kIncognito);
+ command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile,
+ "user");
+ command_line->AppendSwitchASCII(chromeos::switches::kLoginUser,
+ chromeos::UserManager::kGuestUserName);
+ }
+ }
+
private:
StubBrailleController braille_controller_;
DISALLOW_COPY_AND_ASSIGN(SpokenFeedbackTest);
};
-IN_PROC_BROWSER_TEST_F(SpokenFeedbackTest, EnableSpokenFeedback) {
+INSTANTIATE_TEST_CASE_P(
+ TestAsNormalAndGuestUser,
+ SpokenFeedbackTest,
+ ::testing::Values(kTestAsNormalUser,
+ kTestAsGuestUser));
+
+IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, EnableSpokenFeedback) {
EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
SpeechMonitor monitor;
@@ -66,7 +91,7 @@ IN_PROC_BROWSER_TEST_F(SpokenFeedbackTest, EnableSpokenFeedback) {
EXPECT_TRUE(monitor.SkipChromeVoxEnabledMessage());
}
-IN_PROC_BROWSER_TEST_F(SpokenFeedbackTest, FocusToolbar) {
+IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, FocusToolbar) {
EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
SpeechMonitor monitor;
@@ -81,7 +106,7 @@ IN_PROC_BROWSER_TEST_F(SpokenFeedbackTest, FocusToolbar) {
EXPECT_EQ("button", monitor.GetNextUtterance());
}
-IN_PROC_BROWSER_TEST_F(SpokenFeedbackTest, TypeInOmnibox) {
+IN_PROC_BROWSER_TEST_P(SpokenFeedbackTest, TypeInOmnibox) {
EXPECT_FALSE(AccessibilityManager::Get()->IsSpokenFeedbackEnabled());
SpeechMonitor monitor;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698