Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(585)

Side by Side Diff: chrome/browser/ui/ash/launcher/arc_app_launcher_browsertest.cc

Issue 2553673003: [Merge to M55] Reland "Propagate information about how ARC apps are launched" (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "chrome/browser/ui/app_list/app_list_service.h" 11 #include "chrome/browser/ui/app_list/app_list_service.h"
12 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" 12 #include "chrome/browser/ui/app_list/app_list_syncable_service.h"
13 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" 13 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.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.h"
15 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" 15 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
16 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h" 16 #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h"
17 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 17 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
18 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" 18 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h"
19 #include "chromeos/chromeos_switches.h" 19 #include "chromeos/chromeos_switches.h"
20 #include "content/public/test/browser_test_utils.h" 20 #include "content/public/test/browser_test_utils.h"
21 #include "mojo/common/common_type_converters.h" 21 #include "mojo/common/common_type_converters.h"
22 #include "ui/events/event_constants.h"
22 23
23 namespace mojo { 24 namespace mojo {
24 25
25 template <> 26 template <>
26 struct TypeConverter<arc::mojom::AppInfoPtr, arc::mojom::AppInfo> { 27 struct TypeConverter<arc::mojom::AppInfoPtr, arc::mojom::AppInfo> {
27 static arc::mojom::AppInfoPtr Convert(const arc::mojom::AppInfo& app_info) { 28 static arc::mojom::AppInfoPtr Convert(const arc::mojom::AppInfo& app_info) {
28 return app_info.Clone(); 29 return app_info.Clone();
29 } 30 }
30 }; 31 };
31 32
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 StartInstance(); 248 StartInstance();
248 app_info = app_prefs()->GetApp(app_id); 249 app_info = app_prefs()->GetApp(app_id);
249 ASSERT_TRUE(app_info); 250 ASSERT_TRUE(app_info);
250 EXPECT_FALSE(app_info->ready); 251 EXPECT_FALSE(app_info->ready);
251 if (is_pinned()) 252 if (is_pinned())
252 EXPECT_TRUE(shelf_delegate()->GetShelfIDForAppID(app_id)); 253 EXPECT_TRUE(shelf_delegate()->GetShelfIDForAppID(app_id));
253 else 254 else
254 EXPECT_FALSE(shelf_delegate()->GetShelfIDForAppID(app_id)); 255 EXPECT_FALSE(shelf_delegate()->GetShelfIDForAppID(app_id));
255 256
256 // Launching non-ready Arc app creates item on shelf and spinning animation. 257 // Launching non-ready Arc app creates item on shelf and spinning animation.
257 arc::LaunchApp(profile(), app_id); 258 arc::LaunchApp(profile(), app_id, ui::EF_LEFT_MOUSE_BUTTON);
258 EXPECT_TRUE(shelf_delegate()->GetShelfIDForAppID(app_id)); 259 EXPECT_TRUE(shelf_delegate()->GetShelfIDForAppID(app_id));
259 AppAnimatedWaiter(app_id).Wait(); 260 AppAnimatedWaiter(app_id).Wait();
260 261
261 switch (test_action()) { 262 switch (test_action()) {
262 case TEST_ACTION_START: 263 case TEST_ACTION_START:
263 // Now simulates that Arc is started and app list is refreshed. This 264 // Now simulates that Arc is started and app list is refreshed. This
264 // should stop animation and delete icon from the shelf. 265 // should stop animation and delete icon from the shelf.
265 InstallTestApps(false); 266 InstallTestApps(false);
266 SendPackageAdded(false); 267 SendPackageAdded(false);
267 EXPECT_TRUE(chrome_controller() 268 EXPECT_TRUE(chrome_controller()
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 SendPackageAdded(true); 355 SendPackageAdded(true);
355 EXPECT_TRUE(app_list_service->IsAppListVisible()); 356 EXPECT_TRUE(app_list_service->IsAppListVisible());
356 357
357 app_list_service->DismissAppList(); 358 app_list_service->DismissAppList();
358 EXPECT_FALSE(app_list_service->IsAppListVisible()); 359 EXPECT_FALSE(app_list_service->IsAppListVisible());
359 360
360 // Send package update event. App list is not shown. 361 // Send package update event. App list is not shown.
361 SendPackageAdded(true); 362 SendPackageAdded(true);
362 EXPECT_FALSE(app_list_service->IsAppListVisible()); 363 EXPECT_FALSE(app_list_service->IsAppListVisible());
363 } 364 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698