| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 constexpr int kAppAnimatedThresholdMs = 100; | 50 constexpr int kAppAnimatedThresholdMs = 100; |
| 51 | 51 |
| 52 std::string GetTestApp1Id() { | 52 std::string GetTestApp1Id() { |
| 53 return ArcAppListPrefs::GetAppId(kTestAppPackage, kTestAppActivity); | 53 return ArcAppListPrefs::GetAppId(kTestAppPackage, kTestAppActivity); |
| 54 } | 54 } |
| 55 | 55 |
| 56 std::string GetTestApp2Id() { | 56 std::string GetTestApp2Id() { |
| 57 return ArcAppListPrefs::GetAppId(kTestAppPackage, kTestAppActivity2); | 57 return ArcAppListPrefs::GetAppId(kTestAppPackage, kTestAppActivity2); |
| 58 } | 58 } |
| 59 | 59 |
| 60 mojo::Array<arc::mojom::AppInfoPtr> GetTestAppsList(bool multi_app) { | 60 std::vector<arc::mojom::AppInfoPtr> GetTestAppsList(bool multi_app) { |
| 61 std::vector<arc::mojom::AppInfo> apps; | 61 std::vector<arc::mojom::AppInfoPtr> apps; |
| 62 | 62 |
| 63 arc::mojom::AppInfo app; | 63 arc::mojom::AppInfoPtr app(arc::mojom::AppInfo::New()); |
| 64 app.name = kTestAppName; | 64 app->name = kTestAppName; |
| 65 app.package_name = kTestAppPackage; | 65 app->package_name = kTestAppPackage; |
| 66 app.activity = kTestAppActivity; | 66 app->activity = kTestAppActivity; |
| 67 app.sticky = false; | 67 app->sticky = false; |
| 68 apps.push_back(app); | 68 apps.push_back(std::move(app)); |
| 69 | 69 |
| 70 if (multi_app) { | 70 if (multi_app) { |
| 71 app.name = kTestAppName2; | 71 app = arc::mojom::AppInfo::New(); |
| 72 app.package_name = kTestAppPackage; | 72 app->name = kTestAppName2; |
| 73 app.activity = kTestAppActivity2; | 73 app->package_name = kTestAppPackage; |
| 74 app.sticky = false; | 74 app->activity = kTestAppActivity2; |
| 75 apps.push_back(app); | 75 app->sticky = false; |
| 76 apps.push_back(std::move(app)); |
| 76 } | 77 } |
| 77 | 78 |
| 78 return mojo::Array<arc::mojom::AppInfoPtr>::From(apps); | 79 return apps; |
| 79 } | 80 } |
| 80 | 81 |
| 81 ChromeLauncherController* chrome_controller() { | 82 ChromeLauncherController* chrome_controller() { |
| 82 return ChromeLauncherController::instance(); | 83 return ChromeLauncherController::instance(); |
| 83 } | 84 } |
| 84 | 85 |
| 85 ash::ShelfDelegate* shelf_delegate() { | 86 ash::ShelfDelegate* shelf_delegate() { |
| 86 return ash::WmShell::Get()->shelf_delegate(); | 87 return ash::WmShell::Get()->shelf_delegate(); |
| 87 } | 88 } |
| 88 | 89 |
| (...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 AppListService* service = AppListService::Get(); | 373 AppListService* service = AppListService::Get(); |
| 373 AppListControllerDelegate* delegate = service->GetControllerDelegate(); | 374 AppListControllerDelegate* delegate = service->GetControllerDelegate(); |
| 374 EXPECT_FALSE(delegate->IsAppOpen(app_id)); | 375 EXPECT_FALSE(delegate->IsAppOpen(app_id)); |
| 375 arc::LaunchApp(profile(), app_id); | 376 arc::LaunchApp(profile(), app_id); |
| 376 EXPECT_FALSE(delegate->IsAppOpen(app_id)); | 377 EXPECT_FALSE(delegate->IsAppOpen(app_id)); |
| 377 // Simulate task creation so the app is marked as running/open. | 378 // Simulate task creation so the app is marked as running/open. |
| 378 std::unique_ptr<ArcAppListPrefs::AppInfo> info = app_prefs()->GetApp(app_id); | 379 std::unique_ptr<ArcAppListPrefs::AppInfo> info = app_prefs()->GetApp(app_id); |
| 379 app_host()->OnTaskCreated(0, info->package_name, info->activity, info->name); | 380 app_host()->OnTaskCreated(0, info->package_name, info->activity, info->name); |
| 380 EXPECT_TRUE(delegate->IsAppOpen(app_id)); | 381 EXPECT_TRUE(delegate->IsAppOpen(app_id)); |
| 381 } | 382 } |
| OLD | NEW |