| 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 "chrome/browser/ui/app_list/arc/arc_app_dialog.h" | 5 #include "chrome/browser/ui/app_list/arc/arc_app_dialog.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/chromeos/arc/arc_session_manager.h" | 9 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
| 10 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 11 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" | 12 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h" |
| 12 #include "chrome/browser/ui/app_list/app_list_service.h" | 13 #include "chrome/browser/ui/app_list/app_list_service.h" |
| 13 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 14 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
| 14 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h" | 15 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h" |
| 15 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" | 16 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
| 16 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 17 #include "chrome/browser/ui/browser_window.h" | 18 #include "chrome/browser/ui/browser_window.h" |
| 18 #include "chrome/test/base/in_process_browser_test.h" | 19 #include "chrome/test/base/in_process_browser_test.h" |
| 19 #include "components/arc/arc_util.h" | 20 #include "components/arc/arc_util.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 42 | 43 |
| 43 void SetUpOnMainThread() override { | 44 void SetUpOnMainThread() override { |
| 44 InProcessBrowserTest::SetUpOnMainThread(); | 45 InProcessBrowserTest::SetUpOnMainThread(); |
| 45 profile_ = browser()->profile(); | 46 profile_ = browser()->profile(); |
| 46 arc_app_list_pref_ = ArcAppListPrefs::Get(profile_); | 47 arc_app_list_pref_ = ArcAppListPrefs::Get(profile_); |
| 47 if (!arc_app_list_pref_) { | 48 if (!arc_app_list_pref_) { |
| 48 ArcAppListPrefsFactory::GetInstance()->RecreateServiceInstanceForTesting( | 49 ArcAppListPrefsFactory::GetInstance()->RecreateServiceInstanceForTesting( |
| 49 profile_); | 50 profile_); |
| 50 } | 51 } |
| 51 | 52 |
| 52 ArcSessionManager* session_manager = ArcSessionManager::Get(); | 53 arc::SetArcPlayStoreEnabledForProfile(profile_, true); |
| 53 DCHECK(session_manager); | |
| 54 session_manager->SetArcPlayStoreEnabled(true); | |
| 55 | 54 |
| 56 arc_app_list_pref_ = ArcAppListPrefs::Get(profile_); | 55 arc_app_list_pref_ = ArcAppListPrefs::Get(profile_); |
| 57 DCHECK(arc_app_list_pref_); | 56 DCHECK(arc_app_list_pref_); |
| 58 | 57 |
| 59 base::RunLoop run_loop; | 58 base::RunLoop run_loop; |
| 60 arc_app_list_pref_->SetDefaltAppsReadyCallback(run_loop.QuitClosure()); | 59 arc_app_list_pref_->SetDefaltAppsReadyCallback(run_loop.QuitClosure()); |
| 61 run_loop.Run(); | 60 run_loop.Run(); |
| 62 | 61 |
| 63 app_instance_.reset(new arc::FakeAppInstance(arc_app_list_pref_)); | 62 app_instance_.reset(new arc::FakeAppInstance(arc_app_list_pref_)); |
| 64 arc_app_list_pref_->app_instance_holder()->SetInstance(app_instance_.get()); | 63 arc_app_list_pref_->app_instance_holder()->SetInstance(app_instance_.get()); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 content::RunAllPendingInMessageLoop(); | 170 content::RunAllPendingInMessageLoop(); |
| 172 | 171 |
| 173 EXPECT_TRUE(CloseAppDialogViewAndConfirmForTest(true)); | 172 EXPECT_TRUE(CloseAppDialogViewAndConfirmForTest(true)); |
| 174 content::RunAllPendingInMessageLoop(); | 173 content::RunAllPendingInMessageLoop(); |
| 175 app_ids = arc_app_list_pref()->GetAppIds(); | 174 app_ids = arc_app_list_pref()->GetAppIds(); |
| 176 EXPECT_EQ(app_ids.size(), 1u); | 175 EXPECT_EQ(app_ids.size(), 1u); |
| 177 controller->DismissView(); | 176 controller->DismissView(); |
| 178 } | 177 } |
| 179 | 178 |
| 180 } // namespace arc | 179 } // namespace arc |
| OLD | NEW |