| 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/shelf/shelf_util.h" | 7 #include "ash/shelf/shelf_util.h" |
| 8 #include "ash/wm/window_util.h" | 8 #include "ash/wm/window_util.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| 11 #include "chrome/browser/extensions/extension_browsertest.h" | 11 #include "chrome/browser/extensions/extension_browsertest.h" |
| 12 #include "chrome/browser/ui/app_list/app_list_service.h" | 12 #include "chrome/browser/ui/app_list/app_list_service.h" |
| 13 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
| 14 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
| 13 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 15 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
| 14 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" | 16 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
| 15 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h" | 17 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h" |
| 16 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 18 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 17 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" | 19 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" |
| 18 #include "chromeos/chromeos_switches.h" | 20 #include "chromeos/chromeos_switches.h" |
| 19 #include "content/public/test/browser_test_utils.h" | 21 #include "content/public/test/browser_test_utils.h" |
| 20 #include "mojo/common/common_type_converters.h" | 22 #include "mojo/common/common_type_converters.h" |
| 21 | 23 |
| 22 namespace mojo { | 24 namespace mojo { |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 } | 298 } |
| 297 } | 299 } |
| 298 | 300 |
| 299 INSTANTIATE_TEST_CASE_P(ArcAppDeferredLauncherBrowserTestInstance, | 301 INSTANTIATE_TEST_CASE_P(ArcAppDeferredLauncherBrowserTestInstance, |
| 300 ArcAppDeferredLauncherBrowserTest, | 302 ArcAppDeferredLauncherBrowserTest, |
| 301 ::testing::ValuesIn(build_test_parameter)); | 303 ::testing::ValuesIn(build_test_parameter)); |
| 302 | 304 |
| 303 // This tests validates pin state on package update and remove. | 305 // This tests validates pin state on package update and remove. |
| 304 IN_PROC_BROWSER_TEST_F(ArcAppLauncherBrowserTest, PinOnPackageUpdateAndRemove) { | 306 IN_PROC_BROWSER_TEST_F(ArcAppLauncherBrowserTest, PinOnPackageUpdateAndRemove) { |
| 305 StartInstance(); | 307 StartInstance(); |
| 308 |
| 309 // Make use app list sync service is started. Normally it is started when |
| 310 // sycing is initialized. |
| 311 app_list::AppListSyncableServiceFactory::GetForProfile(profile())->GetModel(); |
| 312 |
| 306 InstallTestApps(true); | 313 InstallTestApps(true); |
| 307 SendPackageAdded(false); | 314 SendPackageAdded(false); |
| 308 | 315 |
| 309 const std::string app_id1 = GetTestApp1Id(); | 316 const std::string app_id1 = GetTestApp1Id(); |
| 310 const std::string app_id2 = GetTestApp2Id(); | 317 const std::string app_id2 = GetTestApp2Id(); |
| 311 shelf_delegate()->PinAppWithID(app_id1); | 318 shelf_delegate()->PinAppWithID(app_id1); |
| 312 shelf_delegate()->PinAppWithID(app_id2); | 319 shelf_delegate()->PinAppWithID(app_id2); |
| 313 const ash::ShelfID shelf_id1_before = | 320 const ash::ShelfID shelf_id1_before = |
| 314 shelf_delegate()->GetShelfIDForAppID(app_id1); | 321 shelf_delegate()->GetShelfIDForAppID(app_id1); |
| 315 EXPECT_TRUE(shelf_id1_before); | 322 EXPECT_TRUE(shelf_id1_before); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 SendPackageAdded(true); | 355 SendPackageAdded(true); |
| 349 EXPECT_TRUE(app_list_service->IsAppListVisible()); | 356 EXPECT_TRUE(app_list_service->IsAppListVisible()); |
| 350 | 357 |
| 351 app_list_service->DismissAppList(); | 358 app_list_service->DismissAppList(); |
| 352 EXPECT_FALSE(app_list_service->IsAppListVisible()); | 359 EXPECT_FALSE(app_list_service->IsAppListVisible()); |
| 353 | 360 |
| 354 // Send package update event. App list is not shown. | 361 // Send package update event. App list is not shown. |
| 355 SendPackageAdded(true); | 362 SendPackageAdded(true); |
| 356 EXPECT_FALSE(app_list_service->IsAppListVisible()); | 363 EXPECT_FALSE(app_list_service->IsAppListVisible()); |
| 357 } | 364 } |
| OLD | NEW |