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

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 2574013003: Refactor ArcSessionRunner part 1. (Closed)
Patch Set: rebase to the split CL Created 4 years 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 <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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 #include "chrome/browser/profiles/profile_manager.h" 203 #include "chrome/browser/profiles/profile_manager.h"
204 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h" 204 #include "chrome/browser/ui/ash/chrome_screenshot_grabber.h"
205 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" 205 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
206 #include "chromeos/audio/cras_audio_handler.h" 206 #include "chromeos/audio/cras_audio_handler.h"
207 #include "chromeos/chromeos_switches.h" 207 #include "chromeos/chromeos_switches.h"
208 #include "chromeos/cryptohome/cryptohome_parameters.h" 208 #include "chromeos/cryptohome/cryptohome_parameters.h"
209 #include "chromeos/dbus/dbus_thread_manager.h" 209 #include "chromeos/dbus/dbus_thread_manager.h"
210 #include "chromeos/dbus/fake_session_manager_client.h" 210 #include "chromeos/dbus/fake_session_manager_client.h"
211 #include "chromeos/dbus/session_manager_client.h" 211 #include "chromeos/dbus/session_manager_client.h"
212 #include "components/arc/arc_bridge_service.h" 212 #include "components/arc/arc_bridge_service.h"
213 #include "components/arc/arc_bridge_service_impl.h"
214 #include "components/arc/arc_service_manager.h" 213 #include "components/arc/arc_service_manager.h"
214 #include "components/arc/arc_session_runner.h"
215 #include "components/arc/test/fake_arc_session.h" 215 #include "components/arc/test/fake_arc_session.h"
216 #include "components/signin/core/account_id/account_id.h" 216 #include "components/signin/core/account_id/account_id.h"
217 #include "components/user_manager/user_manager.h" 217 #include "components/user_manager/user_manager.h"
218 #include "ui/keyboard/keyboard_util.h" 218 #include "ui/keyboard/keyboard_util.h"
219 #include "ui/snapshot/screenshot_grabber.h" 219 #include "ui/snapshot/screenshot_grabber.h"
220 #endif 220 #endif
221 221
222 #if !defined(OS_MACOSX) 222 #if !defined(OS_MACOSX)
223 #include "base/compiler_specific.h" 223 #include "base/compiler_specific.h"
224 #include "chrome/browser/ui/extensions/app_launch_params.h" 224 #include "chrome/browser/ui/extensions/app_launch_params.h"
(...skipping 3836 matching lines...) Expand 10 before | Expand all | Expand 10 after
4061 void TearDownTest() { arc::ArcSessionManager::Get()->Shutdown(); } 4061 void TearDownTest() { arc::ArcSessionManager::Get()->Shutdown(); }
4062 4062
4063 void SetUpInProcessBrowserTestFixture() override { 4063 void SetUpInProcessBrowserTestFixture() override {
4064 PolicyTest::SetUpInProcessBrowserTestFixture(); 4064 PolicyTest::SetUpInProcessBrowserTestFixture();
4065 fake_session_manager_client_ = new chromeos::FakeSessionManagerClient; 4065 fake_session_manager_client_ = new chromeos::FakeSessionManagerClient;
4066 fake_session_manager_client_->set_arc_available(true); 4066 fake_session_manager_client_->set_arc_available(true);
4067 chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( 4067 chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient(
4068 std::unique_ptr<chromeos::SessionManagerClient>( 4068 std::unique_ptr<chromeos::SessionManagerClient>(
4069 fake_session_manager_client_)); 4069 fake_session_manager_client_));
4070 4070
4071 // Inject FakeArcSession here so blocking task runner is not needed. 4071 arc::ArcServiceManager::SetArcSessionRunnerForTesting(
4072 auto service = base::MakeUnique<arc::ArcBridgeServiceImpl>(nullptr); 4072 base::MakeUnique<arc::ArcSessionRunner>(
4073 service->SetArcSessionFactoryForTesting( 4073 base::Bind(arc::FakeArcSession::Create)));
4074 base::Bind(arc::FakeArcSession::Create));
4075 arc::ArcServiceManager::SetArcBridgeServiceForTesting(std::move(service));
4076 } 4074 }
4077 4075
4078 void SetUpCommandLine(base::CommandLine* command_line) override { 4076 void SetUpCommandLine(base::CommandLine* command_line) override {
4079 // ArcSessionManager functionality is available only when Arc is enabled. 4077 // ArcSessionManager functionality is available only when Arc is enabled.
4080 // Use kEnableArc switch that activates it. 4078 // Use kEnableArc switch that activates it.
4081 command_line->AppendSwitch(chromeos::switches::kEnableArc); 4079 command_line->AppendSwitch(chromeos::switches::kEnableArc);
4082 } 4080 }
4083 4081
4084 void SetArcEnabledByPolicy(bool enabled) { 4082 void SetArcEnabledByPolicy(bool enabled) {
4085 PolicyMap policies; 4083 PolicyMap policies;
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
4326 4324
4327 SetEmptyPolicy(); 4325 SetEmptyPolicy();
4328 // Policy not set. 4326 // Policy not set.
4329 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4327 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4330 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4328 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4331 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4329 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4332 } 4330 }
4333 #endif // defined(OS_CHROMEOS) 4331 #endif // defined(OS_CHROMEOS)
4334 4332
4335 } // namespace policy 4333 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698