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

Side by Side Diff: chrome/browser/chromeos/system/tray_accessibility_browsertest.cc

Issue 2832153003: Move calling of shared browser test methods like SetUpOnMainThread/TearDownOnMainThread/RunTestOn... (Closed)
Patch Set: sync Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/accessibility_types.h" 5 #include "ash/accessibility_types.h"
6 #include "ash/login_status.h" 6 #include "ash/login_status.h"
7 #include "ash/magnifier/magnification_controller.h" 7 #include "ash/magnifier/magnification_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/system/tray/system_tray.h" 9 #include "ash/system/tray/system_tray.h"
10 #include "ash/system/tray_accessibility.h" 10 #include "ash/system/tray_accessibility.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 void SetUpCommandLine(base::CommandLine* command_line) override { 81 void SetUpCommandLine(base::CommandLine* command_line) override {
82 command_line->AppendSwitch(switches::kLoginManager); 82 command_line->AppendSwitch(switches::kLoginManager);
83 command_line->AppendSwitchASCII(switches::kLoginProfile, 83 command_line->AppendSwitchASCII(switches::kLoginProfile,
84 TestingProfile::kTestUserProfileDir); 84 TestingProfile::kTestUserProfileDir);
85 } 85 }
86 86
87 void SetUpOnMainThread() override { 87 void SetUpOnMainThread() override {
88 AccessibilityManager::Get()->SetProfileForTest(GetProfile()); 88 AccessibilityManager::Get()->SetProfileForTest(GetProfile());
89 MagnificationManager::Get()->SetProfileForTest(GetProfile()); 89 MagnificationManager::Get()->SetProfileForTest(GetProfile());
90 }
91
92 void RunTestOnMainThreadLoop() override {
93 // Need to mark oobe completed to show detailed views. 90 // Need to mark oobe completed to show detailed views.
94 StartupUtils::MarkOobeCompleted(); 91 StartupUtils::MarkOobeCompleted();
95 InProcessBrowserTest::RunTestOnMainThreadLoop();
96 } 92 }
97 93
98 void TearDownOnMainThread() override { 94 void TearDownOnMainThread() override {
99 AccessibilityManager::SetBrailleControllerForTest(NULL); 95 AccessibilityManager::SetBrailleControllerForTest(NULL);
100 } 96 }
101 97
102 void SetShowAccessibilityOptionsInSystemTrayMenu(bool value) { 98 void SetShowAccessibilityOptionsInSystemTrayMenu(bool value) {
103 if (GetParam() == PREF_SERVICE) { 99 if (GetParam() == PREF_SERVICE) {
104 PrefService* prefs = GetProfile()->GetPrefs(); 100 PrefService* prefs = GetProfile()->GetPrefs();
105 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, value); 101 prefs->SetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu, value);
(...skipping 1602 matching lines...) Expand 10 before | Expand all | Expand 10 after
1708 EXPECT_TRUE(IsTapDraggingMenuShownOnDetailMenu()); 1704 EXPECT_TRUE(IsTapDraggingMenuShownOnDetailMenu());
1709 CloseDetailMenu(); 1705 CloseDetailMenu();
1710 } 1706 }
1711 1707
1712 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, 1708 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance,
1713 TrayAccessibilityTest, 1709 TrayAccessibilityTest,
1714 testing::Values(PREF_SERVICE, 1710 testing::Values(PREF_SERVICE,
1715 POLICY)); 1711 POLICY));
1716 1712
1717 } // namespace chromeos 1713 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698