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

Unified Diff: components/ntp_snippets/ntp_snippets_service_unittest.cc

Issue 1978513002: Getting the personalization info in chrome://snippets-internals correct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: After code review #2 Created 4 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 | « components/ntp_snippets/ntp_snippets_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/ntp_snippets_service_unittest.cc
diff --git a/components/ntp_snippets/ntp_snippets_service_unittest.cc b/components/ntp_snippets/ntp_snippets_service_unittest.cc
index 797759b77f88767ea2a0aa0b2707a32eb97b3a3e..ddadb629c8168b613b32b11ffeadd530fabf6480 100644
--- a/components/ntp_snippets/ntp_snippets_service_unittest.cc
+++ b/components/ntp_snippets/ntp_snippets_service_unittest.cc
@@ -411,24 +411,27 @@ TEST_F(NTPSnippetsServiceTest, LimitNumSnippets) {
TEST_F(NTPSnippetsServiceTest, LoadInvalidJson) {
LoadFromJSONString(GetInvalidJson());
- EXPECT_THAT(service()->last_status(), StartsWith("Received invalid JSON"));
+ EXPECT_THAT(service()->snippets_fetcher()->last_status(),
+ StartsWith("Received invalid JSON"));
EXPECT_THAT(service()->snippets(), IsEmpty());
}
TEST_F(NTPSnippetsServiceTest, LoadInvalidJsonWithExistingSnippets) {
LoadFromJSONString(GetTestJson());
ASSERT_THAT(service()->snippets(), SizeIs(1));
- ASSERT_EQ("OK", service()->last_status());
+ ASSERT_EQ("OK", service()->snippets_fetcher()->last_status());
LoadFromJSONString(GetInvalidJson());
- EXPECT_THAT(service()->last_status(), StartsWith("Received invalid JSON"));
+ EXPECT_THAT(service()->snippets_fetcher()->last_status(),
+ StartsWith("Received invalid JSON"));
// This should not have changed the existing snippets.
EXPECT_THAT(service()->snippets(), SizeIs(1));
}
TEST_F(NTPSnippetsServiceTest, LoadIncompleteJson) {
LoadFromJSONString(GetIncompleteJson());
- EXPECT_EQ("Invalid / empty list.", service()->last_status());
+ EXPECT_EQ("Invalid / empty list.",
+ service()->snippets_fetcher()->last_status());
EXPECT_THAT(service()->snippets(), IsEmpty());
}
@@ -437,7 +440,8 @@ TEST_F(NTPSnippetsServiceTest, LoadIncompleteJsonWithExistingSnippets) {
ASSERT_THAT(service()->snippets(), SizeIs(1));
LoadFromJSONString(GetIncompleteJson());
- EXPECT_EQ("Invalid / empty list.", service()->last_status());
+ EXPECT_EQ("Invalid / empty list.",
+ service()->snippets_fetcher()->last_status());
// This should not have changed the existing snippets.
EXPECT_THAT(service()->snippets(), SizeIs(1));
}
« no previous file with comments | « components/ntp_snippets/ntp_snippets_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698