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

Unified Diff: components/doodle/doodle_fetcher_impl_unittest.cc

Issue 2743273002: [Doodle] Don't create invalid DoodleImages or DoodleConfigs (Closed)
Patch Set: 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
« no previous file with comments | « no previous file | components/doodle/doodle_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/doodle/doodle_fetcher_impl_unittest.cc
diff --git a/components/doodle/doodle_fetcher_impl_unittest.cc b/components/doodle/doodle_fetcher_impl_unittest.cc
index 939b7b82bd61ac49a38e3a752650bb3e932d07fe..b29e4ee35bcadd99fff7db84dede14bd8c948003 100644
--- a/components/doodle/doodle_fetcher_impl_unittest.cc
+++ b/components/doodle/doodle_fetcher_impl_unittest.cc
@@ -347,15 +347,6 @@ TEST_F(DoodleFetcherImplTest, ResponseContainsExactlyTheSampleImages) {
ASSERT_TRUE(response.has_value());
DoodleConfig config = response.value();
- EXPECT_TRUE(config.transparent_large_image.url.is_valid());
- EXPECT_THAT(config.transparent_large_image.url.spec(),
- Eq(Resolve("/logos/doodles/2015/new-years-eve-2015-5985438795"
- "8251-thp.png")));
- EXPECT_THAT(config.transparent_large_image.width, Eq(510));
- EXPECT_THAT(config.transparent_large_image.height, Eq(225));
- EXPECT_FALSE(config.transparent_large_image.is_animated_gif);
- EXPECT_FALSE(config.transparent_large_image.is_cta);
-
EXPECT_TRUE(config.large_image.url.is_valid());
EXPECT_THAT(config.large_image.url.spec(),
Eq(Resolve("/logos/doodles/2015/new-years-eve-2015-5985438795"
@@ -365,14 +356,25 @@ TEST_F(DoodleFetcherImplTest, ResponseContainsExactlyTheSampleImages) {
EXPECT_TRUE(config.large_image.is_animated_gif);
EXPECT_FALSE(config.large_image.is_cta);
- EXPECT_TRUE(config.large_cta_image.url.is_valid());
- EXPECT_THAT(config.large_cta_image.url.spec(),
+ ASSERT_TRUE(config.transparent_large_image.has_value());
sfiera 2017/03/13 10:29:49 Shouldn't there be some tests in this file that de
Marc Treib 2017/03/13 10:50:33 I'd argue that most of this doesn't really belong
+ EXPECT_TRUE(config.transparent_large_image->url.is_valid());
+ EXPECT_THAT(config.transparent_large_image->url.spec(),
+ Eq(Resolve("/logos/doodles/2015/new-years-eve-2015-5985438795"
+ "8251-thp.png")));
+ EXPECT_THAT(config.transparent_large_image->width, Eq(510));
+ EXPECT_THAT(config.transparent_large_image->height, Eq(225));
+ EXPECT_FALSE(config.transparent_large_image->is_animated_gif);
+ EXPECT_FALSE(config.transparent_large_image->is_cta);
+
+ ASSERT_TRUE(config.large_cta_image.has_value());
+ EXPECT_TRUE(config.large_cta_image->url.is_valid());
+ EXPECT_THAT(config.large_cta_image->url.spec(),
Eq(Resolve("/logos/doodles/2015/new-years-eve-2015-5985438795"
"8251-cta.gif")));
- EXPECT_THAT(config.large_cta_image.width, Eq(489));
- EXPECT_THAT(config.large_cta_image.height, Eq(225));
- EXPECT_TRUE(config.large_cta_image.is_animated_gif);
- EXPECT_TRUE(config.large_cta_image.is_cta);
+ EXPECT_THAT(config.large_cta_image->width, Eq(489));
+ EXPECT_THAT(config.large_cta_image->height, Eq(225));
+ EXPECT_TRUE(config.large_cta_image->is_animated_gif);
+ EXPECT_TRUE(config.large_cta_image->is_cta);
}
TEST_F(DoodleFetcherImplTest, RespondsToMultipleRequestsWithSameFetcher) {
« no previous file with comments | « no previous file | components/doodle/doodle_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698