| 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 "ash/common/shelf/shelf_delegate.h" | 5 #include "ash/common/shelf/shelf_delegate.h" |
| 6 #include "ash/common/wm_shell.h" | 6 #include "ash/common/wm_shell.h" |
| 7 #include "ash/wm/window_util.h" | 7 #include "ash/wm/window_util.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "chrome/browser/chromeos/arc/arc_session_manager.h" |
| 13 #include "chrome/browser/chromeos/arc/arc_util.h" |
| 12 #include "chrome/browser/extensions/extension_browsertest.h" | 14 #include "chrome/browser/extensions/extension_browsertest.h" |
| 13 #include "chrome/browser/ui/app_list/app_list_service.h" | 15 #include "chrome/browser/ui/app_list/app_list_service.h" |
| 14 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | 16 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
| 15 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" | 17 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
| 16 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 18 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
| 17 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" | 19 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
| 18 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h" | 20 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h" |
| 19 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" | 21 #include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h" |
| 20 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 22 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 21 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" | 23 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 ExtensionBrowserTest::SetUpCommandLine(command_line); | 161 ExtensionBrowserTest::SetUpCommandLine(command_line); |
| 160 arc::SetArcAvailableCommandLineForTesting(command_line); | 162 arc::SetArcAvailableCommandLineForTesting(command_line); |
| 161 } | 163 } |
| 162 | 164 |
| 163 void SetUpInProcessBrowserTestFixture() override { | 165 void SetUpInProcessBrowserTestFixture() override { |
| 164 ExtensionBrowserTest::SetUpInProcessBrowserTestFixture(); | 166 ExtensionBrowserTest::SetUpInProcessBrowserTestFixture(); |
| 165 arc::ArcSessionManager::DisableUIForTesting(); | 167 arc::ArcSessionManager::DisableUIForTesting(); |
| 166 } | 168 } |
| 167 | 169 |
| 168 void SetUpOnMainThread() override { | 170 void SetUpOnMainThread() override { |
| 169 arc::ArcSessionManager::Get()->SetArcPlayStoreEnabled(true); | 171 arc::SetArcPlayStoreEnabledForProfile(profile(), true); |
| 170 } | 172 } |
| 171 | 173 |
| 172 void InstallTestApps(const std::string& package_name, bool multi_app) { | 174 void InstallTestApps(const std::string& package_name, bool multi_app) { |
| 173 app_host()->OnAppListRefreshed(GetTestAppsList(package_name, multi_app)); | 175 app_host()->OnAppListRefreshed(GetTestAppsList(package_name, multi_app)); |
| 174 | 176 |
| 175 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = | 177 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = |
| 176 app_prefs()->GetApp(GetTestApp1Id(package_name)); | 178 app_prefs()->GetApp(GetTestApp1Id(package_name)); |
| 177 ASSERT_TRUE(app_info); | 179 ASSERT_TRUE(app_info); |
| 178 EXPECT_TRUE(app_info->ready); | 180 EXPECT_TRUE(app_info->ready); |
| 179 if (multi_app) { | 181 if (multi_app) { |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 EXPECT_FALSE(GetAppItemController(shelf_id1)); | 540 EXPECT_FALSE(GetAppItemController(shelf_id1)); |
| 539 | 541 |
| 540 // Destroy task #1, shelf group 2 is still alive | 542 // Destroy task #1, shelf group 2 is still alive |
| 541 app_host()->OnTaskDestroyed(2); | 543 app_host()->OnTaskDestroyed(2); |
| 542 EXPECT_EQ(controller2, GetAppItemController(shelf_id2)); | 544 EXPECT_EQ(controller2, GetAppItemController(shelf_id2)); |
| 543 // Destroy task #2, this kills shelf group 2 | 545 // Destroy task #2, this kills shelf group 2 |
| 544 app_host()->OnTaskDestroyed(3); | 546 app_host()->OnTaskDestroyed(3); |
| 545 EXPECT_FALSE(GetAppItemController(shelf_id2)); | 547 EXPECT_FALSE(GetAppItemController(shelf_id2)); |
| 546 | 548 |
| 547 // Disable ARC, this removes app and as result kills shelf group 3. | 549 // Disable ARC, this removes app and as result kills shelf group 3. |
| 548 arc::ArcSessionManager::Get()->SetArcPlayStoreEnabled(false); | 550 arc::SetArcPlayStoreEnabledForProfile(profile(), false); |
| 549 EXPECT_FALSE(GetAppItemController(shelf_id3)); | 551 EXPECT_FALSE(GetAppItemController(shelf_id3)); |
| 550 } | 552 } |
| OLD | NEW |