| 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 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 25 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 25 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
| 26 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" | 26 #include "chrome/browser/ui/ash/multi_user/multi_user_util.h" |
| 27 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 #include "chrome/test/base/testing_profile.h" | 28 #include "chrome/test/base/testing_profile.h" |
| 29 #include "chromeos/chromeos_switches.h" | 29 #include "chromeos/chromeos_switches.h" |
| 30 #include "chromeos/dbus/dbus_thread_manager.h" | 30 #include "chromeos/dbus/dbus_thread_manager.h" |
| 31 #include "chromeos/dbus/fake_session_manager_client.h" | 31 #include "chromeos/dbus/fake_session_manager_client.h" |
| 32 #include "components/arc/arc_service_manager.h" | 32 #include "components/arc/arc_service_manager.h" |
| 33 #include "components/arc/arc_session_runner.h" | 33 #include "components/arc/arc_session_runner.h" |
| 34 #include "components/arc/arc_util.h" |
| 34 #include "components/arc/test/fake_arc_session.h" | 35 #include "components/arc/test/fake_arc_session.h" |
| 35 #include "components/prefs/pref_service.h" | 36 #include "components/prefs/pref_service.h" |
| 36 #include "components/signin/core/account_id/account_id.h" | 37 #include "components/signin/core/account_id/account_id.h" |
| 37 #include "components/sync/model/fake_sync_change_processor.h" | 38 #include "components/sync/model/fake_sync_change_processor.h" |
| 38 #include "components/sync/model/sync_error_factory_mock.h" | 39 #include "components/sync/model/sync_error_factory_mock.h" |
| 39 #include "components/sync_preferences/testing_pref_service_syncable.h" | 40 #include "components/sync_preferences/testing_pref_service_syncable.h" |
| 40 #include "components/user_manager/user_manager.h" | 41 #include "components/user_manager/user_manager.h" |
| 41 #include "components/user_manager/user_names.h" | 42 #include "components/user_manager/user_names.h" |
| 42 #include "content/public/browser/browser_thread.h" | 43 #include "content/public/browser/browser_thread.h" |
| 43 #include "content/public/test/test_browser_thread_bundle.h" | 44 #include "content/public/test/test_browser_thread_bundle.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 54 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), | 55 : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP), |
| 55 user_manager_enabler_(new chromeos::FakeChromeUserManager()) {} | 56 user_manager_enabler_(new chromeos::FakeChromeUserManager()) {} |
| 56 ~ArcSessionManagerTestBase() override = default; | 57 ~ArcSessionManagerTestBase() override = default; |
| 57 | 58 |
| 58 void SetUp() override { | 59 void SetUp() override { |
| 59 chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( | 60 chromeos::DBusThreadManager::GetSetterForTesting()->SetSessionManagerClient( |
| 60 base::MakeUnique<chromeos::FakeSessionManagerClient>()); | 61 base::MakeUnique<chromeos::FakeSessionManagerClient>()); |
| 61 | 62 |
| 62 chromeos::DBusThreadManager::Initialize(); | 63 chromeos::DBusThreadManager::Initialize(); |
| 63 | 64 |
| 64 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 65 SetArcAvailableCommandLineForTesting( |
| 65 chromeos::switches::kEnableArc); | 66 base::CommandLine::ForCurrentProcess()); |
| 66 ArcSessionManager::DisableUIForTesting(); | 67 ArcSessionManager::DisableUIForTesting(); |
| 67 | 68 |
| 68 EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); | 69 EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 69 TestingProfile::Builder profile_builder; | 70 TestingProfile::Builder profile_builder; |
| 70 profile_builder.SetProfileName("user@gmail.com"); | 71 profile_builder.SetProfileName("user@gmail.com"); |
| 71 profile_builder.SetPath(temp_dir_.GetPath().AppendASCII("TestArcProfile")); | 72 profile_builder.SetPath(temp_dir_.GetPath().AppendASCII("TestArcProfile")); |
| 72 | 73 |
| 73 profile_ = profile_builder.Build(); | 74 profile_ = profile_builder.Build(); |
| 74 StartPreferenceSyncing(); | 75 StartPreferenceSyncing(); |
| 75 | 76 |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 bool terminated = false; | 521 bool terminated = false; |
| 521 arc_session_manager()->SetAttemptUserExitCallbackForTesting( | 522 arc_session_manager()->SetAttemptUserExitCallbackForTesting( |
| 522 base::Bind([](bool* terminated) { *terminated = true; }, &terminated)); | 523 base::Bind([](bool* terminated) { *terminated = true; }, &terminated)); |
| 523 | 524 |
| 524 arc_session_manager()->OnProvisioningFinished( | 525 arc_session_manager()->OnProvisioningFinished( |
| 525 ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR); | 526 ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR); |
| 526 EXPECT_TRUE(terminated); | 527 EXPECT_TRUE(terminated); |
| 527 } | 528 } |
| 528 | 529 |
| 529 } // namespace arc | 530 } // namespace arc |
| OLD | NEW |