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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc

Issue 2807483002: [Merge M58] arg: Make shortcuts runnable in deferred mode. (Closed)
Patch Set: Created 3 years, 8 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
index 57574c368c98b82b8f0ef383fe80c2ec0adb07ef..816d3d47721d717040f13e9856f7c977bc5525b6 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl_unittest.cc
@@ -878,6 +878,10 @@ class ChromeLauncherControllerImplTest : public BrowserWithTestWindowTest {
arc_test_.app_instance()->SendRefreshAppList(arc_test_.fake_apps());
}
+ void SendListOfArcShortcuts() {
+ arc_test_.app_instance()->SendInstallShortcuts(arc_test_.fake_shortcuts());
+ }
+
void UninstallArcApps() {
arc_test_.app_instance()->RefreshAppList();
arc_test_.app_instance()->SendRefreshAppList(
@@ -1848,11 +1852,14 @@ TEST_F(ChromeLauncherControllerImplWithArcTest, ArcDeferredLaunch) {
const arc::mojom::AppInfo& app1 = arc_test_.fake_apps()[0];
const arc::mojom::AppInfo& app2 = arc_test_.fake_apps()[1];
const arc::mojom::AppInfo& app3 = arc_test_.fake_apps()[2];
+ const arc::mojom::ShortcutInfo& shortcut = arc_test_.fake_shortcuts()[0];
const std::string arc_app_id1 = ArcAppTest::GetAppId(app1);
const std::string arc_app_id2 = ArcAppTest::GetAppId(app2);
const std::string arc_app_id3 = ArcAppTest::GetAppId(app3);
+ const std::string arc_shortcut_id = ArcAppTest::GetAppId(shortcut);
SendListOfArcApps();
+ SendListOfArcShortcuts();
arc_test_.StopArcInstance();
@@ -1862,12 +1869,14 @@ TEST_F(ChromeLauncherControllerImplWithArcTest, ArcDeferredLaunch) {
launcher_controller_->GetShelfIDForAppID(arc_app_id2));
EXPECT_EQ(ash::kInvalidShelfID,
launcher_controller_->GetShelfIDForAppID(arc_app_id3));
+ EXPECT_EQ(ash::kInvalidShelfID,
+ launcher_controller_->GetShelfIDForAppID(arc_shortcut_id));
arc::LaunchApp(profile(), arc_app_id1, ui::EF_LEFT_MOUSE_BUTTON);
arc::LaunchApp(profile(), arc_app_id1, ui::EF_LEFT_MOUSE_BUTTON);
arc::LaunchApp(profile(), arc_app_id2, ui::EF_LEFT_MOUSE_BUTTON);
arc::LaunchApp(profile(), arc_app_id3, ui::EF_LEFT_MOUSE_BUTTON);
- arc::LaunchApp(profile(), arc_app_id3, ui::EF_LEFT_MOUSE_BUTTON);
+ arc::LaunchApp(profile(), arc_shortcut_id, ui::EF_LEFT_MOUSE_BUTTON);
const ash::ShelfID shelf_id_app_1 =
launcher_controller_->GetShelfIDForAppID(arc_app_id1);
@@ -1875,9 +1884,12 @@ TEST_F(ChromeLauncherControllerImplWithArcTest, ArcDeferredLaunch) {
launcher_controller_->GetShelfIDForAppID(arc_app_id2);
const ash::ShelfID shelf_id_app_3 =
launcher_controller_->GetShelfIDForAppID(arc_app_id3);
+ const ash::ShelfID shelf_id_shortcut =
+ launcher_controller_->GetShelfIDForAppID(arc_shortcut_id);
EXPECT_NE(ash::kInvalidShelfID, shelf_id_app_1);
EXPECT_NE(ash::kInvalidShelfID, shelf_id_app_2);
EXPECT_NE(ash::kInvalidShelfID, shelf_id_app_3);
+ EXPECT_NE(ash::kInvalidShelfID, shelf_id_shortcut);
// We activated arc_app_id1 twice but expect one close for item controller
// stops launching request.
@@ -1899,6 +1911,8 @@ TEST_F(ChromeLauncherControllerImplWithArcTest, ArcDeferredLaunch) {
base::RunLoop().RunUntilIdle();
+ // Now deferred contollers should go away together with shelf items and ARC
+ // app instance should receive request for launching apps and shortcuts.
EXPECT_EQ(ash::kInvalidShelfID,
launcher_controller_->GetShelfIDForAppID(arc_app_id1));
EXPECT_EQ(ash::kInvalidShelfID,
@@ -1907,6 +1921,7 @@ TEST_F(ChromeLauncherControllerImplWithArcTest, ArcDeferredLaunch) {
launcher_controller_->GetShelfIDForAppID(arc_app_id3));
ASSERT_EQ(2U, arc_test_.app_instance()->launch_requests().size());
+ ASSERT_EQ(1U, arc_test_.app_instance()->launch_intents().size());
const arc::FakeAppInstance::Request* request1 =
arc_test_.app_instance()->launch_requests()[0].get();
@@ -1915,6 +1930,8 @@ TEST_F(ChromeLauncherControllerImplWithArcTest, ArcDeferredLaunch) {
EXPECT_TRUE((request1->IsForApp(app2) && request2->IsForApp(app3)) ||
(request1->IsForApp(app3) && request2->IsForApp(app2)));
+ EXPECT_EQ(arc_test_.app_instance()->launch_intents()[0].c_str(),
+ shortcut.intent_uri);
}
// Ensure the deferred controller does not override the active app controller
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698