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

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: check if request was already scheduled 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/ash/launcher/arc_playstore_shortcut_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 0ed295f97d6c81054c847ce96435f9299e6ca1f8..2392a9619e006aad23d02fbdfbf6a8b9dbc91e16 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,34 @@ 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();
+
+ EnablePlayStore(true);
+
+ // Pin Play Store. It should be pinned but not scheduled 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 schedule Play Store for deferred launch.
+ 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) {
« no previous file with comments | « chrome/browser/ui/ash/launcher/arc_playstore_shortcut_launcher_item_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698