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

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

Issue 2896323004: Revert of arc: Invalide app icon on package update. (Closed)
Patch Set: Created 3 years, 7 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_list_prefs.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/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 25374b72c1ff9c8dc856310a56d0d1df1408404d..2d7b5e5415cb045d4e1e7bbb717e1c775907fd65 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_unittest.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_unittest.cc
@@ -1341,79 +1341,6 @@
EXPECT_EQ(1 + scale_factors.size(), delegate.update_image_cnt());
}
-TEST_P(ArcAppModelBuilderTest, IconInvalidation) {
- std::vector<ui::ScaleFactor> supported_scale_factors;
- supported_scale_factors.push_back(ui::SCALE_FACTOR_100P);
- supported_scale_factors.push_back(ui::SCALE_FACTOR_200P);
- ui::test::ScopedSetSupportedScaleFactors scoped_supported_scale_factors(
- supported_scale_factors);
-
- ASSERT_FALSE(fake_apps().empty());
- std::vector<arc::mojom::AppInfo> apps = std::vector<arc::mojom::AppInfo>(
- fake_apps().begin(), fake_apps().begin() + 1);
-
- const arc::mojom::AppInfo& app = apps[0];
- const std::string app_id = ArcAppTest::GetAppId(app);
-
- ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile_.get());
- ASSERT_NE(nullptr, prefs);
-
- app_instance()->RefreshAppList();
- app_instance()->SendRefreshAppList(apps);
-
- prefs->MaybeRequestIcon(app_id, ui::SCALE_FACTOR_100P);
-
- std::string png_data;
- EXPECT_TRUE(app_instance()->GenerateAndSendIcon(
- app, arc::mojom::ScaleFactor::SCALE_FACTOR_100P, &png_data));
- WaitForIconUpdates(profile_.get(), app_id, 1);
-
- // Simulate ARC restart.
- arc_test()->TearDown();
- ArcAppListPrefsFactory::GetInstance()->RecreateServiceInstanceForTesting(
- profile_.get());
- arc_test()->SetUp(profile_.get());
- prefs = ArcAppListPrefs::Get(profile_.get());
- ASSERT_NE(nullptr, prefs);
- app_instance()->RefreshAppList();
- app_instance()->SendRefreshAppList(apps);
-
- // No icon update requests on restart. Icons were not invalidated.
- EXPECT_TRUE(app_instance()->icon_requests().empty());
-
- // Send new apps for the package. This should invalidate app icons.
- app_instance()->SendPackageAppListRefreshed(apps[0].package_name, apps);
- base::RunLoop().RunUntilIdle();
-
- // Requests to reload icons are issued for all supported scales.
- const std::vector<std::unique_ptr<arc::FakeAppInstance::IconRequest>>&
- icon_requests = app_instance()->icon_requests();
- ASSERT_EQ(2U, icon_requests.size());
- EXPECT_TRUE(icon_requests[0]->IsForApp(app));
- EXPECT_EQ(icon_requests[0]->scale_factor(), ui::SCALE_FACTOR_100P);
- EXPECT_TRUE(icon_requests[1]->IsForApp(app));
- EXPECT_EQ(icon_requests[1]->scale_factor(), ui::SCALE_FACTOR_200P);
-
- EXPECT_TRUE(app_instance()->GenerateAndSendIcon(
- app, arc::mojom::ScaleFactor::SCALE_FACTOR_100P, &png_data));
- EXPECT_TRUE(app_instance()->GenerateAndSendIcon(
- app, arc::mojom::ScaleFactor::SCALE_FACTOR_200P, &png_data));
- WaitForIconUpdates(profile_.get(), app_id, 2);
-
- // Simulate ARC restart again.
- arc_test()->TearDown();
- ArcAppListPrefsFactory::GetInstance()->RecreateServiceInstanceForTesting(
- profile_.get());
- arc_test()->SetUp(profile_.get());
- prefs = ArcAppListPrefs::Get(profile_.get());
- ASSERT_NE(nullptr, prefs);
- app_instance()->RefreshAppList();
- app_instance()->SendRefreshAppList(apps);
-
- // No new icon update requests on restart. Icons were invalidated and updated.
- EXPECT_TRUE(app_instance()->icon_requests().empty());
-}
-
TEST_P(ArcAppModelBuilderTest, AppLauncher) {
ArcAppListPrefs* prefs = ArcAppListPrefs::Get(profile());
ASSERT_NE(nullptr, prefs);
@@ -1486,7 +1413,7 @@
ASSERT_NE(nullptr, prefs);
std::vector<arc::mojom::AppInfo> apps = fake_apps();
- ASSERT_GE(apps.size(), 3U);
+ ASSERT_GE(3u, apps.size());
apps[0].package_name = apps[2].package_name;
apps[1].package_name = apps[2].package_name;
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698