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

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

Issue 2282023002: arc: Support window recreation. (Closed)
Patch Set: rebase + nits Created 4 years, 4 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/ash/launcher/arc_app_window_launcher_item_controller.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 eba29f8ef775487526586b09fed439f3d0905fb4..40eb059bb5c494c2ecdd7b21d8df17c931373500 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
@@ -1886,11 +1886,39 @@ TEST_F(ChromeLauncherControllerImplTest, ArcRaceCreateClose) {
EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id2));
arc_window->Close();
base::RunLoop().RunUntilIdle();
- EXPECT_EQ(0, launcher_controller_->GetShelfIDForAppID(arc_app_id2));
+ // Closing window does not close shelf item. It is closed on task destroy.
+ EXPECT_NE(0, launcher_controller_->GetShelfIDForAppID(arc_app_id2));
arc_test_.app_instance()->SendTaskDestroyed(2);
EXPECT_EQ(0, launcher_controller_->GetShelfIDForAppID(arc_app_id2));
}
+TEST_F(ChromeLauncherControllerImplTest, ArcWindowRecreation) {
+ arc_test_.SetUp(profile());
+ InitLauncherController();
+
+ const std::string arc_app_id = ArcAppTest::GetAppId(arc_test_.fake_apps()[0]);
+ SendListOfArcApps();
+
+ std::string window_app_id("org.chromium.arc.1");
+ views::Widget* arc_window = CreateArcWindow(window_app_id);
+ ASSERT_TRUE(arc_window);
+ arc_test_.app_instance()->SendTaskCreated(1, arc_test_.fake_apps()[0]);
+ const ash::ShelfID shelf_id =
+ launcher_controller_->GetShelfIDForAppID(arc_app_id);
+ EXPECT_NE(0, shelf_id);
+
+ for (int i = 0; i < 3; ++i) {
+ arc_window->Close();
+ base::RunLoop().RunUntilIdle();
+ EXPECT_EQ(shelf_id, launcher_controller_->GetShelfIDForAppID(arc_app_id));
+
+ arc_window = CreateArcWindow(window_app_id);
+ ASSERT_TRUE(arc_window);
+ base::RunLoop().RunUntilIdle();
+ EXPECT_EQ(shelf_id, launcher_controller_->GetShelfIDForAppID(arc_app_id));
+ }
+}
+
// Validate that Arc app is pinned correctly and pin is removed automatically
// once app is uninstalled.
TEST_F(ChromeLauncherControllerImplTest, ArcAppPin) {
« no previous file with comments | « chrome/browser/ui/ash/launcher/arc_app_window_launcher_item_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698