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

Unified Diff: chrome/browser/extensions/bookmark_app_helper_unittest.cc

Issue 1066623008: Sync bookmark app icon urls and sizes, and download icons for new apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix failing tests and extra checks Created 5 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
Index: chrome/browser/extensions/bookmark_app_helper_unittest.cc
diff --git a/chrome/browser/extensions/bookmark_app_helper_unittest.cc b/chrome/browser/extensions/bookmark_app_helper_unittest.cc
index dc5c7e6b99508f32a1fa8e7b8a705e54892a830c..5db4bc05cfa1d054366947766b768a2b81b74530 100644
--- a/chrome/browser/extensions/bookmark_app_helper_unittest.cc
+++ b/chrome/browser/extensions/bookmark_app_helper_unittest.cc
@@ -97,14 +97,9 @@ void ValidateWebApplicationInfo(base::Closure callback,
EXPECT_EQ(expected.title, actual.title);
EXPECT_EQ(expected.description, actual.description);
EXPECT_EQ(expected.app_url, actual.app_url);
- EXPECT_EQ(expected.icons.size(), actual.icons.size());
- for (size_t i = 0; i < expected.icons.size(); ++i) {
- EXPECT_EQ(expected.icons[i].width, actual.icons[i].width);
- EXPECT_EQ(expected.icons[i].height, actual.icons[i].height);
- EXPECT_EQ(expected.icons[i].url, actual.icons[i].url);
- EXPECT_TRUE(
- gfx::BitmapsAreEqual(expected.icons[i].data, actual.icons[i].data));
- }
+ // There should be 6 icons, as there are three sizes which need to be
+ // generated, and each will generate a 1x and 2x icon.
+ EXPECT_EQ(6u, actual.icons.size());
callback.Run();
}
@@ -226,8 +221,7 @@ TEST_F(BookmarkAppHelperExtensionServiceTest, CreateBookmarkAppNoContents) {
EXPECT_EQ(kAppTitle, extension->name());
EXPECT_EQ(kAppDescription, extension->description());
EXPECT_EQ(GURL(kAppUrl), AppLaunchInfo::GetLaunchWebURL(extension));
- // The tiny icon should have been removed and only the generated ones used.
- EXPECT_TRUE(
+ EXPECT_FALSE(
IconsInfo::GetIconResource(extension, kIconSizeTiny,
ExtensionIconSet::MATCH_EXACTLY).empty());
EXPECT_FALSE(
@@ -285,9 +279,9 @@ TEST_F(BookmarkAppHelperExtensionServiceTest, CreateAndUpdateBookmarkApp) {
EXPECT_EQ(kAlternativeAppTitle, extension->name());
EXPECT_EQ(kAppDescription, extension->description());
EXPECT_EQ(GURL(kAppUrl), AppLaunchInfo::GetLaunchWebURL(extension));
- EXPECT_TRUE(extensions::IconsInfo::GetIconResource(
- extension, kIconSizeSmall, ExtensionIconSet::MATCH_EXACTLY)
- .empty());
+ EXPECT_FALSE(extensions::IconsInfo::GetIconResource(
+ extension, kIconSizeSmall, ExtensionIconSet::MATCH_EXACTLY)
+ .empty());
EXPECT_FALSE(extensions::IconsInfo::GetIconResource(
extension, kIconSizeLarge, ExtensionIconSet::MATCH_EXACTLY)
.empty());
@@ -300,11 +294,6 @@ TEST_F(BookmarkAppHelperExtensionServiceTest, GetWebApplicationInfo) {
web_app_info.title = base::UTF8ToUTF16(kAppTitle);
web_app_info.description = base::UTF8ToUTF16(kAppDescription);
- web_app_info.icons.push_back(
- CreateIconInfoWithBitmap(kIconSizeSmall, SK_ColorRED));
- web_app_info.icons.push_back(
- CreateIconInfoWithBitmap(kIconSizeLarge, SK_ColorRED));
-
extensions::CreateOrUpdateBookmarkApp(service_, &web_app_info);
base::RunLoop().RunUntilIdle();

Powered by Google App Engine
This is Rietveld 408576698