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_accessibility.h" | 8 #include "ash/system/tray_accessibility.h" |
9 #include "ash/system/user/login_status.h" | 9 #include "ash/system/user/login_status.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 18 matching lines...) Expand all Loading... | |
29 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
30 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
31 #include "chrome/test/base/in_process_browser_test.h" | 31 #include "chrome/test/base/in_process_browser_test.h" |
32 #include "chrome/test/base/testing_profile.h" | 32 #include "chrome/test/base/testing_profile.h" |
33 #include "chromeos/chromeos_switches.h" | 33 #include "chromeos/chromeos_switches.h" |
34 #include "content/public/test/test_utils.h" | 34 #include "content/public/test/test_utils.h" |
35 #include "policy/policy_constants.h" | 35 #include "policy/policy_constants.h" |
36 #include "testing/gtest/include/gtest/gtest.h" | 36 #include "testing/gtest/include/gtest/gtest.h" |
37 #include "ui/views/widget/widget.h" | 37 #include "ui/views/widget/widget.h" |
38 | 38 |
39 using testing::AnyNumber; | 39 using testing::AnyNumber; |
bartfab (slow)
2013/11/05 15:53:04
Nit: No longer used.
Joao da Silva
2013/11/07 13:15:00
Done.
| |
40 using testing::Return; | 40 using testing::Return; |
41 using testing::_; | 41 using testing::_; |
42 using testing::WithParamInterface; | 42 using testing::WithParamInterface; |
43 | 43 |
44 namespace chromeos { | 44 namespace chromeos { |
45 | 45 |
46 enum PrefSettingMechanism { | 46 enum PrefSettingMechanism { |
47 PREF_SERVICE, | 47 PREF_SERVICE, |
48 POLICY, | 48 POLICY, |
49 }; | 49 }; |
50 | 50 |
51 void SetMagnifierEnabled(bool enabled) { | 51 void SetMagnifierEnabled(bool enabled) { |
52 MagnificationManager::Get()->SetMagnifierEnabled(enabled); | 52 MagnificationManager::Get()->SetMagnifierEnabled(enabled); |
53 } | 53 } |
54 | 54 |
55 class TrayAccessibilityTest | 55 class TrayAccessibilityTest |
56 : public InProcessBrowserTest, | 56 : public InProcessBrowserTest, |
57 public WithParamInterface<PrefSettingMechanism> { | 57 public WithParamInterface<PrefSettingMechanism> { |
58 protected: | 58 protected: |
59 TrayAccessibilityTest() {} | 59 TrayAccessibilityTest() {} |
60 virtual ~TrayAccessibilityTest() {} | 60 virtual ~TrayAccessibilityTest() {} |
61 | 61 |
62 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 62 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
63 EXPECT_CALL(provider_, IsInitializationComplete(_)) | 63 EXPECT_CALL(provider_, IsInitializationComplete(_)) |
64 .WillRepeatedly(Return(true)); | 64 .WillRepeatedly(Return(true)); |
65 EXPECT_CALL(provider_, RegisterPolicyDomain(_)).Times(AnyNumber()); | |
66 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); | 65 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); |
67 } | 66 } |
68 | 67 |
69 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 68 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
70 command_line->AppendSwitch(switches::kLoginManager); | 69 command_line->AppendSwitch(switches::kLoginManager); |
71 command_line->AppendSwitchASCII(switches::kLoginProfile, | 70 command_line->AppendSwitchASCII(switches::kLoginProfile, |
72 TestingProfile::kTestUserProfileDir); | 71 TestingProfile::kTestUserProfileDir); |
73 } | 72 } |
74 | 73 |
75 virtual void SetUpOnMainThread() OVERRIDE { | 74 virtual void SetUpOnMainThread() OVERRIDE { |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
697 EXPECT_TRUE(IsAutoclickMenuShownOnDetailMenu()); | 696 EXPECT_TRUE(IsAutoclickMenuShownOnDetailMenu()); |
698 CloseDetailMenu(); | 697 CloseDetailMenu(); |
699 } | 698 } |
700 | 699 |
701 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, | 700 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, |
702 TrayAccessibilityTest, | 701 TrayAccessibilityTest, |
703 testing::Values(PREF_SERVICE, | 702 testing::Values(PREF_SERVICE, |
704 POLICY)); | 703 POLICY)); |
705 | 704 |
706 } // namespace chromeos | 705 } // namespace chromeos |
OLD | NEW |