| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 chromeos::FakeSessionManagerClient* const fake_session_manager_client = | 135 chromeos::FakeSessionManagerClient* const fake_session_manager_client = |
| 136 new chromeos::FakeSessionManagerClient; | 136 new chromeos::FakeSessionManagerClient; |
| 137 fake_session_manager_client->set_arc_available(true); | 137 fake_session_manager_client->set_arc_available(true); |
| 138 chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( | 138 chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( |
| 139 std::unique_ptr<chromeos::SessionManagerClient>( | 139 std::unique_ptr<chromeos::SessionManagerClient>( |
| 140 fake_session_manager_client)); | 140 fake_session_manager_client)); |
| 141 | 141 |
| 142 // Mock out ARC bridge. | 142 // Mock out ARC bridge. |
| 143 fake_arc_bridge_instance_.reset(new FakeArcBridgeInstance); | 143 fake_arc_bridge_instance_.reset(new FakeArcBridgeInstance); |
| 144 ArcServiceManager::SetArcBridgeServiceForTesting( | 144 ArcServiceManager::SetArcBridgeServiceForTesting( |
| 145 base::WrapUnique(new ArcBridgeServiceImpl(base::WrapUnique( | 145 base::MakeUnique<ArcBridgeServiceImpl>(base::WrapUnique( |
| 146 new FakeArcBridgeBootstrap(fake_arc_bridge_instance_.get()))))); | 146 new FakeArcBridgeBootstrap(fake_arc_bridge_instance_.get())))); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void SetUpOnMainThread() override { | 149 void SetUpOnMainThread() override { |
| 150 user_manager_enabler_.reset(new chromeos::ScopedUserManagerEnabler( | 150 user_manager_enabler_.reset(new chromeos::ScopedUserManagerEnabler( |
| 151 new chromeos::FakeChromeUserManager)); | 151 new chromeos::FakeChromeUserManager)); |
| 152 // Init ArcAuthService for testing. | 152 // Init ArcAuthService for testing. |
| 153 ArcAuthService::DisableUIForTesting(); | 153 ArcAuthService::DisableUIForTesting(); |
| 154 ArcAuthService::EnableCheckAndroidManagementForTesting(); | 154 ArcAuthService::EnableCheckAndroidManagementForTesting(); |
| 155 | 155 |
| 156 EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); | 156 EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 | 247 |
| 248 prefs->SetBoolean(prefs::kArcEnabled, true); | 248 prefs->SetBoolean(prefs::kArcEnabled, true); |
| 249 token_service()->IssueTokenForAllPendingRequests(kManagedAuthToken, | 249 token_service()->IssueTokenForAllPendingRequests(kManagedAuthToken, |
| 250 base::Time::Max()); | 250 base::Time::Max()); |
| 251 ArcAuthServiceShutdownObserver observer; | 251 ArcAuthServiceShutdownObserver observer; |
| 252 observer.Wait(); | 252 observer.Wait(); |
| 253 ASSERT_EQ(ArcAuthService::State::STOPPED, ArcAuthService::Get()->state()); | 253 ASSERT_EQ(ArcAuthService::State::STOPPED, ArcAuthService::Get()->state()); |
| 254 } | 254 } |
| 255 | 255 |
| 256 } // namespace arc | 256 } // namespace arc |
| OLD | NEW |