OLD | NEW |
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/magnifier/magnification_controller.h" | 5 #include "ash/magnifier/magnification_controller.h" |
6 #include "ash/shell.h" | 6 #include "ash/shell.h" |
7 #include "ash/system/tray/system_tray.h" | 7 #include "ash/system/tray/system_tray.h" |
8 #include "ash/system/tray/tray_views.h" | 8 #include "ash/system/tray/tray_views.h" |
9 #include "ash/system/tray_accessibility.h" | 9 #include "ash/system/tray_accessibility.h" |
10 #include "ash/system/user/login_status.h" | 10 #include "ash/system/user/login_status.h" |
11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
12 #include "base/prefs/pref_service.h" | 12 #include "base/prefs/pref_service.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 14 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
15 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 15 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
16 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" | 16 #include "chrome/browser/chromeos/cros/cros_in_process_browser_test.h" |
17 #include "chrome/browser/chromeos/login/helper.h" | 17 #include "chrome/browser/chromeos/login/helper.h" |
18 #include "chrome/browser/chromeos/login/login_utils.h" | 18 #include "chrome/browser/chromeos/login/login_utils.h" |
19 #include "chrome/browser/chromeos/login/user_manager.h" | 19 #include "chrome/browser/chromeos/login/user_manager.h" |
20 #include "chrome/browser/chromeos/login/user_manager_impl.h" | 20 #include "chrome/browser/chromeos/login/user_manager_impl.h" |
| 21 #include "chrome/browser/chromeos/login/wizard_controller.h" |
21 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
22 #include "chrome/browser/profiles/profile_manager.h" | 23 #include "chrome/browser/profiles/profile_manager.h" |
23 #include "chrome/common/chrome_notification_types.h" | 24 #include "chrome/common/chrome_notification_types.h" |
24 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
26 #include "chrome/test/base/testing_profile.h" | 27 #include "chrome/test/base/testing_profile.h" |
27 #include "content/public/test/test_utils.h" | 28 #include "content/public/test/test_utils.h" |
28 #include "testing/gtest/include/gtest/gtest.h" | 29 #include "testing/gtest/include/gtest/gtest.h" |
29 #include "ui/views/widget/widget.h" | 30 #include "ui/views/widget/widget.h" |
30 | 31 |
31 namespace chromeos { | 32 namespace chromeos { |
32 | 33 |
33 void SetMagnifierEnabled(bool enabled) { | 34 void SetMagnifierEnabled(bool enabled) { |
34 MagnificationManager::Get()->SetMagnifierEnabled(enabled); | 35 MagnificationManager::Get()->SetMagnifierEnabled(enabled); |
35 } | 36 } |
36 | 37 |
37 class TrayAccessibilityTest : public CrosInProcessBrowserTest { | 38 class TrayAccessibilityTest : public CrosInProcessBrowserTest { |
38 protected: | 39 protected: |
39 TrayAccessibilityTest() {} | 40 TrayAccessibilityTest() {} |
40 virtual ~TrayAccessibilityTest() {} | 41 virtual ~TrayAccessibilityTest() {} |
| 42 |
41 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 43 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
42 command_line->AppendSwitch(switches::kLoginManager); | 44 command_line->AppendSwitch(switches::kLoginManager); |
43 command_line->AppendSwitchASCII(switches::kLoginProfile, | 45 command_line->AppendSwitchASCII(switches::kLoginProfile, |
44 TestingProfile::kTestUserProfileDir); | 46 TestingProfile::kTestUserProfileDir); |
45 } | 47 } |
46 | 48 |
| 49 virtual void RunTestOnMainThreadLoop() OVERRIDE { |
| 50 // Need to mark oobe completed to show detailed views. |
| 51 WizardController::MarkOobeCompleted(); |
| 52 CrosInProcessBrowserTest::RunTestOnMainThreadLoop(); |
| 53 } |
| 54 |
47 ash::internal::TrayAccessibility* tray() { | 55 ash::internal::TrayAccessibility* tray() { |
48 return ash::Shell::GetInstance()->GetPrimarySystemTray()-> | 56 return ash::Shell::GetInstance()->GetPrimarySystemTray()-> |
49 GetTrayAccessibilityForTest(); | 57 GetTrayAccessibilityForTest(); |
50 } | 58 } |
51 | 59 |
52 bool IsTrayIconVisible() { | 60 bool IsTrayIconVisible() { |
53 return tray()->tray_icon_visible_; | 61 return tray()->tray_icon_visible_; |
54 } | 62 } |
55 | 63 |
56 views::View* CreateMenuItem() { | 64 views::View* CreateMenuItem() { |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 accessibility::EnableHighContrast(false); | 473 accessibility::EnableHighContrast(false); |
466 SetMagnifierEnabled(false); | 474 SetMagnifierEnabled(false); |
467 EXPECT_TRUE(CreateDetailedMenu()); | 475 EXPECT_TRUE(CreateDetailedMenu()); |
468 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); | 476 EXPECT_FALSE(IsSpokenFeedbackEnabledOnDetailMenu()); |
469 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); | 477 EXPECT_FALSE(IsHighContrastEnabledOnDetailMenu()); |
470 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); | 478 EXPECT_FALSE(IsScreenMagnifierEnabledOnDetailMenu()); |
471 CloseDetailMenu(); | 479 CloseDetailMenu(); |
472 } | 480 } |
473 | 481 |
474 } // namespace chromeos | 482 } // namespace chromeos |
OLD | NEW |