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

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

Issue 2793223002: arc: Fix crash activating Play Store in deferred mode. (Closed)
Patch Set: clean up Created 3 years, 9 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
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 0ed295f97d6c81054c847ce96435f9299e6ca1f8..7e38186d0fa5056ecdd4804f56b58b8b355c0028 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
@@ -4171,6 +4171,35 @@ TEST_P(ChromeLauncherControllerArcDefaultAppsTest, DefaultApps) {
EXPECT_FALSE(launcher_controller_->GetArcDeferredLauncher()->HasApp(app_id));
}
+TEST_P(ChromeLauncherControllerArcDefaultAppsTest, PlayStoreDeferredLaunch) {
+ // Add ARC host app to enable Play Store default app.
+ extension_service_->AddExtension(arc_support_host_.get());
+ arc_test_.SetUp(profile());
+ ArcAppListPrefs* const prefs = arc_test_.arc_app_list_prefs();
+ EXPECT_TRUE(prefs->IsRegistered(arc::kPlayStoreAppId));
+
+ InitLauncherController();
+ ChromeLauncherController::set_instance_for_test(launcher_controller_.get());
msw 2017/04/04 01:42:05 This is not necessary
khmel 2017/04/04 16:52:26 Done.
+
+ EnablePlayStore(true);
+
+ // Pin Play Store. It should be pinned but not registered for deferred launch.
+ launcher_controller_->PinAppWithID(arc::kPlayStoreAppId);
+ EXPECT_TRUE(launcher_controller_->IsAppPinned(arc::kPlayStoreAppId));
+ EXPECT_FALSE(launcher_controller_->GetArcDeferredLauncher()->HasApp(
+ arc::kPlayStoreAppId));
+
+ // Simulate click. This should register deferred controller.
msw 2017/04/04 01:42:05 nit: explain what deferred controller you mean mor
khmel 2017/04/04 16:52:26 Done.
+ LauncherItemController* item_controller =
+ launcher_controller_->GetLauncherItemController(
+ launcher_controller_->GetShelfIDForAppID(arc::kPlayStoreAppId));
+ EXPECT_TRUE(item_controller);
+ SelectItem(item_controller);
+ EXPECT_TRUE(launcher_controller_->IsAppPinned(arc::kPlayStoreAppId));
+ EXPECT_TRUE(launcher_controller_->GetArcDeferredLauncher()->HasApp(
+ arc::kPlayStoreAppId));
+}
+
// Checks the case when several app items have the same ordinal position (which
// is valid case).
TEST_F(ChromeLauncherControllerImplTest, CheckPositionConflict) {

Powered by Google App Engine
This is Rietveld 408576698