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

Unified Diff: chrome/browser/ui/app_list/arc/arc_app_unittest.cc

Issue 2210143003: arc: Handle non-launchable apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit_tests due rebase and mojo param order change - trivial 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
Index: chrome/browser/ui/app_list/arc/arc_app_unittest.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_app_unittest.cc b/chrome/browser/ui/app_list/arc/arc_app_unittest.cc
index 4ef89ee76a81f71aff1b3388b7fc5c747262b2ac..8e59f4763436ee148362c9a4a6cf9d73e5267519 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_unittest.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_unittest.cc
@@ -911,3 +911,26 @@ TEST_F(ArcAppModelBuilderTest, AppLauncher) {
ASSERT_EQ(2u, app_instance()->launch_requests().size());
EXPECT_TRUE(app_instance()->launch_requests()[1]->IsForApp(app2));
}
+
+// Validates an app that have no launchable flag.
+TEST_F(ArcAppModelBuilderTest, NonLaunchableApp) {
+ ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_.get());
+ ASSERT_NE(nullptr, prefs);
+
+ ValidateHaveApps(std::vector<arc::mojom::AppInfo>());
+ app_instance()->RefreshAppList();
+ // Send all except first.
+ std::vector<arc::mojom::AppInfo> apps(fake_apps().begin() + 1,
+ fake_apps().end());
+ app_instance()->SendRefreshAppList(apps);
+ ValidateHaveApps(apps);
+
+ const std::string app_id = ArcAppTest::GetAppId(fake_apps()[0]);
+
+ EXPECT_FALSE(prefs->IsRegistered(app_id));
+ EXPECT_FALSE(FindArcItem(app_id));
+ app_instance()->SendTaskCreated(0, fake_apps()[0]);
+ // App should not appear now in the model but should be registered.
+ EXPECT_FALSE(FindArcItem(app_id));
+ EXPECT_TRUE(prefs->IsRegistered(app_id));
+}
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc ('k') | chrome/browser/ui/app_list/arc/arc_app_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698