OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <map> | 10 #include <map> |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "ash/test/ash_test_helper.h" | 24 #include "ash/test/ash_test_helper.h" |
25 #include "ash/test/test_session_state_delegate.h" | 25 #include "ash/test/test_session_state_delegate.h" |
26 #include "ash/test/test_shell_delegate.h" | 26 #include "ash/test/test_shell_delegate.h" |
27 #include "ash/wm/window_util.h" | 27 #include "ash/wm/window_util.h" |
28 #include "base/command_line.h" | 28 #include "base/command_line.h" |
29 #include "base/compiler_specific.h" | 29 #include "base/compiler_specific.h" |
30 #include "base/files/file_path.h" | 30 #include "base/files/file_path.h" |
31 #include "base/location.h" | 31 #include "base/location.h" |
32 #include "base/macros.h" | 32 #include "base/macros.h" |
33 #include "base/memory/ptr_util.h" | 33 #include "base/memory/ptr_util.h" |
34 #include "base/message_loop/message_loop.h" | 34 #include "base/run_loop.h" |
35 #include "base/single_thread_task_runner.h" | 35 #include "base/single_thread_task_runner.h" |
36 #include "base/strings/utf_string_conversions.h" | 36 #include "base/strings/utf_string_conversions.h" |
37 #include "base/threading/thread_task_runner_handle.h" | |
38 #include "base/values.h" | 37 #include "base/values.h" |
39 #include "build/build_config.h" | 38 #include "build/build_config.h" |
40 #include "chrome/browser/chromeos/arc/arc_support_host.h" | 39 #include "chrome/browser/chromeos/arc/arc_support_host.h" |
41 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" | 40 #include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h" |
42 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" | 41 #include "chrome/browser/chromeos/login/users/scoped_user_manager_enabler.h" |
43 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 42 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
44 #include "chrome/browser/extensions/extension_service.h" | 43 #include "chrome/browser/extensions/extension_service.h" |
45 #include "chrome/browser/extensions/test_extension_system.h" | 44 #include "chrome/browser/extensions/test_extension_system.h" |
46 #include "chrome/browser/lifetime/scoped_keep_alive.h" | 45 #include "chrome/browser/lifetime/scoped_keep_alive.h" |
47 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" | 46 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1097 void TearDown() override { | 1096 void TearDown() override { |
1098 ChromeLauncherControllerImplTest::TearDown(); | 1097 ChromeLauncherControllerImplTest::TearDown(); |
1099 user_manager_enabler_.reset(); | 1098 user_manager_enabler_.reset(); |
1100 for (ProfileToNameMap::iterator it = created_profiles_.begin(); | 1099 for (ProfileToNameMap::iterator it = created_profiles_.begin(); |
1101 it != created_profiles_.end(); ++it) | 1100 it != created_profiles_.end(); ++it) |
1102 profile_manager_->DeleteTestingProfile(it->second); | 1101 profile_manager_->DeleteTestingProfile(it->second); |
1103 chromeos::WallpaperManager::Shutdown(); | 1102 chromeos::WallpaperManager::Shutdown(); |
1104 | 1103 |
1105 // A Task is leaked if we don't destroy everything, then run the message | 1104 // A Task is leaked if we don't destroy everything, then run the message |
1106 // loop. | 1105 // loop. |
1107 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1106 base::RunLoop().RunUntilIdle(); |
1108 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); | |
1109 base::MessageLoop::current()->Run(); | |
1110 } | 1107 } |
1111 | 1108 |
1112 // Creates a profile for a given |user_name|. Note that this class will keep | 1109 // Creates a profile for a given |user_name|. Note that this class will keep |
1113 // the ownership of the created object. | 1110 // the ownership of the created object. |
1114 TestingProfile* CreateMultiUserProfile(const std::string& user_name) { | 1111 TestingProfile* CreateMultiUserProfile(const std::string& user_name) { |
1115 const std::string email_string = user_name + "@example.com"; | 1112 const std::string email_string = user_name + "@example.com"; |
1116 const AccountId account_id(AccountId::FromUserEmail(email_string)); | 1113 const AccountId account_id(AccountId::FromUserEmail(email_string)); |
1117 ash::test::AshTestHelper::GetTestSessionStateDelegate()->AddUser( | 1114 ash::test::AshTestHelper::GetTestSessionStateDelegate()->AddUser( |
1118 account_id); | 1115 account_id); |
1119 // Add a user to the fake user manager. | 1116 // Add a user to the fake user manager. |
(...skipping 2712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3832 EXPECT_TRUE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id)); | 3829 EXPECT_TRUE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id)); |
3833 | 3830 |
3834 std::string window_app_id("org.chromium.arc.1"); | 3831 std::string window_app_id("org.chromium.arc.1"); |
3835 CreateArcWindow(window_app_id); | 3832 CreateArcWindow(window_app_id); |
3836 arc_test_.app_instance()->SendTaskCreated(1, | 3833 arc_test_.app_instance()->SendTaskCreated(1, |
3837 arc_test_.fake_default_apps()[0]); | 3834 arc_test_.fake_default_apps()[0]); |
3838 | 3835 |
3839 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(app_id)); | 3836 EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(app_id)); |
3840 EXPECT_FALSE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id)); | 3837 EXPECT_FALSE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id)); |
3841 } | 3838 } |
OLD | NEW |