| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 #include <stdint.h> | 6 #include <stdint.h> |
| 7 | 7 |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 #include "chromeos/audio/cras_audio_handler.h" | 208 #include "chromeos/audio/cras_audio_handler.h" |
| 209 #include "chromeos/chromeos_switches.h" | 209 #include "chromeos/chromeos_switches.h" |
| 210 #include "chromeos/cryptohome/cryptohome_parameters.h" | 210 #include "chromeos/cryptohome/cryptohome_parameters.h" |
| 211 #include "chromeos/dbus/dbus_thread_manager.h" | 211 #include "chromeos/dbus/dbus_thread_manager.h" |
| 212 #include "chromeos/dbus/fake_session_manager_client.h" | 212 #include "chromeos/dbus/fake_session_manager_client.h" |
| 213 #include "chromeos/dbus/session_manager_client.h" | 213 #include "chromeos/dbus/session_manager_client.h" |
| 214 #include "components/arc/arc_bridge_service.h" | 214 #include "components/arc/arc_bridge_service.h" |
| 215 #include "components/arc/arc_bridge_service_impl.h" | 215 #include "components/arc/arc_bridge_service_impl.h" |
| 216 #include "components/arc/arc_service_manager.h" | 216 #include "components/arc/arc_service_manager.h" |
| 217 #include "components/arc/test/fake_arc_bridge_bootstrap.h" | 217 #include "components/arc/test/fake_arc_bridge_bootstrap.h" |
| 218 #include "components/arc/test/fake_arc_bridge_instance.h" | |
| 219 #include "components/signin/core/account_id/account_id.h" | 218 #include "components/signin/core/account_id/account_id.h" |
| 220 #include "components/user_manager/user_manager.h" | 219 #include "components/user_manager/user_manager.h" |
| 221 #include "ui/keyboard/keyboard_util.h" | 220 #include "ui/keyboard/keyboard_util.h" |
| 222 #include "ui/snapshot/screenshot_grabber.h" | 221 #include "ui/snapshot/screenshot_grabber.h" |
| 223 #endif | 222 #endif |
| 224 | 223 |
| 225 #if !defined(OS_MACOSX) | 224 #if !defined(OS_MACOSX) |
| 226 #include "base/compiler_specific.h" | 225 #include "base/compiler_specific.h" |
| 227 #include "chrome/browser/ui/extensions/app_launch_params.h" | 226 #include "chrome/browser/ui/extensions/app_launch_params.h" |
| 228 #include "chrome/browser/ui/extensions/application_launch.h" | 227 #include "chrome/browser/ui/extensions/application_launch.h" |
| (...skipping 3879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4108 } | 4107 } |
| 4109 | 4108 |
| 4110 void SetUpInProcessBrowserTestFixture() override { | 4109 void SetUpInProcessBrowserTestFixture() override { |
| 4111 PolicyTest::SetUpInProcessBrowserTestFixture(); | 4110 PolicyTest::SetUpInProcessBrowserTestFixture(); |
| 4112 fake_session_manager_client_ = new chromeos::FakeSessionManagerClient; | 4111 fake_session_manager_client_ = new chromeos::FakeSessionManagerClient; |
| 4113 fake_session_manager_client_->set_arc_available(true); | 4112 fake_session_manager_client_->set_arc_available(true); |
| 4114 chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( | 4113 chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( |
| 4115 std::unique_ptr<chromeos::SessionManagerClient>( | 4114 std::unique_ptr<chromeos::SessionManagerClient>( |
| 4116 fake_session_manager_client_)); | 4115 fake_session_manager_client_)); |
| 4117 | 4116 |
| 4118 fake_arc_bridge_instance_.reset(new arc::FakeArcBridgeInstance); | 4117 auto service = base::MakeUnique<arc::ArcBridgeServiceImpl>(); |
| 4119 arc::ArcServiceManager::SetArcBridgeServiceForTesting( | 4118 service->SetArcBridgeBootstrapFactoryForTesting( |
| 4120 base::MakeUnique<arc::ArcBridgeServiceImpl>(base::WrapUnique( | 4119 base::Bind(arc::FakeArcBridgeBootstrap::Create)); |
| 4121 new arc::FakeArcBridgeBootstrap(fake_arc_bridge_instance_.get())))); | 4120 arc::ArcServiceManager::SetArcBridgeServiceForTesting(std::move(service)); |
| 4122 } | 4121 } |
| 4123 | 4122 |
| 4124 void SetUpCommandLine(base::CommandLine* command_line) override { | 4123 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 4125 // ArcAuthService functionality is available only when Arc is enabled. Use | 4124 // ArcAuthService functionality is available only when Arc is enabled. Use |
| 4126 // kEnableArc switch that activates it. | 4125 // kEnableArc switch that activates it. |
| 4127 command_line->AppendSwitch(chromeos::switches::kEnableArc); | 4126 command_line->AppendSwitch(chromeos::switches::kEnableArc); |
| 4128 } | 4127 } |
| 4129 | 4128 |
| 4130 private: | 4129 private: |
| 4131 chromeos::FakeSessionManagerClient *fake_session_manager_client_; | 4130 chromeos::FakeSessionManagerClient *fake_session_manager_client_; |
| 4132 std::unique_ptr<arc::FakeArcBridgeInstance> fake_arc_bridge_instance_; | |
| 4133 | 4131 |
| 4134 DISALLOW_COPY_AND_ASSIGN(ArcPolicyTest); | 4132 DISALLOW_COPY_AND_ASSIGN(ArcPolicyTest); |
| 4135 }; | 4133 }; |
| 4136 | 4134 |
| 4137 // Test ArcEnabled policy. | 4135 // Test ArcEnabled policy. |
| 4138 IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcEnabled) { | 4136 IN_PROC_BROWSER_TEST_F(ArcPolicyTest, ArcEnabled) { |
| 4139 SetUpTest(); | 4137 SetUpTest(); |
| 4140 | 4138 |
| 4141 const PrefService* const pref = browser()->profile()->GetPrefs(); | 4139 const PrefService* const pref = browser()->profile()->GetPrefs(); |
| 4142 const arc::ArcBridgeService* const arc_bridge_service | 4140 const arc::ArcBridgeService* const arc_bridge_service |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4369 | 4367 |
| 4370 SetEmptyPolicy(); | 4368 SetEmptyPolicy(); |
| 4371 // Policy not set. | 4369 // Policy not set. |
| 4372 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4370 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
| 4373 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4371 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
| 4374 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4372 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
| 4375 } | 4373 } |
| 4376 #endif // defined(OS_CHROMEOS) | 4374 #endif // defined(OS_CHROMEOS) |
| 4377 | 4375 |
| 4378 } // namespace policy | 4376 } // namespace policy |
| OLD | NEW |