| 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; | |
| 40 using testing::Return; | 39 using testing::Return; |
| 41 using testing::_; | 40 using testing::_; |
| 42 using testing::WithParamInterface; | 41 using testing::WithParamInterface; |
| 43 | 42 |
| 44 namespace chromeos { | 43 namespace chromeos { |
| 45 | 44 |
| 46 enum PrefSettingMechanism { | 45 enum PrefSettingMechanism { |
| 47 PREF_SERVICE, | 46 PREF_SERVICE, |
| 48 POLICY, | 47 POLICY, |
| 49 }; | 48 }; |
| 50 | 49 |
| 51 void SetMagnifierEnabled(bool enabled) { | 50 void SetMagnifierEnabled(bool enabled) { |
| 52 MagnificationManager::Get()->SetMagnifierEnabled(enabled); | 51 MagnificationManager::Get()->SetMagnifierEnabled(enabled); |
| 53 } | 52 } |
| 54 | 53 |
| 55 class TrayAccessibilityTest | 54 class TrayAccessibilityTest |
| 56 : public InProcessBrowserTest, | 55 : public InProcessBrowserTest, |
| 57 public WithParamInterface<PrefSettingMechanism> { | 56 public WithParamInterface<PrefSettingMechanism> { |
| 58 protected: | 57 protected: |
| 59 TrayAccessibilityTest() {} | 58 TrayAccessibilityTest() {} |
| 60 virtual ~TrayAccessibilityTest() {} | 59 virtual ~TrayAccessibilityTest() {} |
| 61 | 60 |
| 62 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 61 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { |
| 63 EXPECT_CALL(provider_, IsInitializationComplete(_)) | 62 EXPECT_CALL(provider_, IsInitializationComplete(_)) |
| 64 .WillRepeatedly(Return(true)); | 63 .WillRepeatedly(Return(true)); |
| 65 EXPECT_CALL(provider_, RegisterPolicyDomain(_)).Times(AnyNumber()); | |
| 66 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); | 64 policy::BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); |
| 67 } | 65 } |
| 68 | 66 |
| 69 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 67 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
| 70 command_line->AppendSwitch(switches::kLoginManager); | 68 command_line->AppendSwitch(switches::kLoginManager); |
| 71 command_line->AppendSwitchASCII(switches::kLoginProfile, | 69 command_line->AppendSwitchASCII(switches::kLoginProfile, |
| 72 TestingProfile::kTestUserProfileDir); | 70 TestingProfile::kTestUserProfileDir); |
| 73 } | 71 } |
| 74 | 72 |
| 75 virtual void SetUpOnMainThread() OVERRIDE { | 73 virtual void SetUpOnMainThread() OVERRIDE { |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 EXPECT_TRUE(IsAutoclickMenuShownOnDetailMenu()); | 695 EXPECT_TRUE(IsAutoclickMenuShownOnDetailMenu()); |
| 698 CloseDetailMenu(); | 696 CloseDetailMenu(); |
| 699 } | 697 } |
| 700 | 698 |
| 701 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, | 699 INSTANTIATE_TEST_CASE_P(TrayAccessibilityTestInstance, |
| 702 TrayAccessibilityTest, | 700 TrayAccessibilityTest, |
| 703 testing::Values(PREF_SERVICE, | 701 testing::Values(PREF_SERVICE, |
| 704 POLICY)); | 702 POLICY)); |
| 705 | 703 |
| 706 } // namespace chromeos | 704 } // namespace chromeos |
| OLD | NEW |