| 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 "chrome/browser/extensions/extension_browsertest.h" | 10 #include "chrome/browser/extensions/extension_browsertest.h" |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 SendPackageAdded(true); | 354 SendPackageAdded(true); |
| 355 EXPECT_TRUE(app_list_service->IsAppListVisible()); | 355 EXPECT_TRUE(app_list_service->IsAppListVisible()); |
| 356 | 356 |
| 357 app_list_service->DismissAppList(); | 357 app_list_service->DismissAppList(); |
| 358 EXPECT_FALSE(app_list_service->IsAppListVisible()); | 358 EXPECT_FALSE(app_list_service->IsAppListVisible()); |
| 359 | 359 |
| 360 // Send package update event. App list is not shown. | 360 // Send package update event. App list is not shown. |
| 361 SendPackageAdded(true); | 361 SendPackageAdded(true); |
| 362 EXPECT_FALSE(app_list_service->IsAppListVisible()); | 362 EXPECT_FALSE(app_list_service->IsAppListVisible()); |
| 363 } | 363 } |
| 364 |
| 365 // Test AppListControllerDelegate::IsAppOpen for Arc apps. |
| 366 IN_PROC_BROWSER_TEST_F(ArcAppLauncherBrowserTest, IsAppOpen) { |
| 367 StartInstance(); |
| 368 InstallTestApps(false); |
| 369 SendPackageAdded(true); |
| 370 const std::string app_id = GetTestApp1Id(); |
| 371 |
| 372 AppListService* service = AppListService::Get(); |
| 373 AppListControllerDelegate* delegate = service->GetControllerDelegate(); |
| 374 EXPECT_FALSE(delegate->IsAppOpen(app_id)); |
| 375 arc::LaunchApp(profile(), app_id); |
| 376 EXPECT_FALSE(delegate->IsAppOpen(app_id)); |
| 377 // Simulate task creation so the app is marked as running/open. |
| 378 std::unique_ptr<ArcAppListPrefs::AppInfo> info = app_prefs()->GetApp(app_id); |
| 379 app_host()->OnTaskCreated(0, info->package_name, info->activity, info->name); |
| 380 EXPECT_TRUE(delegate->IsAppOpen(app_id)); |
| 381 } |
| OLD | NEW |