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

Unified Diff: components/ntp_snippets/ntp_snippet_unittest.cc

Issue 2110393004: Parse snippet times properly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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_snippet.cc ('k') | components/ntp_snippets/ntp_snippets_fetcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/ntp_snippet_unittest.cc
diff --git a/components/ntp_snippets/ntp_snippet_unittest.cc b/components/ntp_snippets/ntp_snippet_unittest.cc
index c0698a3c21fe655cf4cf50fa1c40c725dc23c486..6e254c66929731fdc2248625fc5bc956286ceccb 100644
--- a/components/ntp_snippets/ntp_snippet_unittest.cc
+++ b/components/ntp_snippets/ntp_snippet_unittest.cc
@@ -19,14 +19,8 @@ TEST(NTPSnippetTest, FromChromeContentSuggestionsDictionary) {
" \"title\" : \"Foo Barred from Baz\","
" \"summaryText\" : \"...\","
" \"fullPageUrl\" : \"http://localhost/foobar\","
- " \"publishTime\" : {"
- " \"seconds\": 1466510682,"
- " \"nanos\": 552743000 "
- " },"
- " \"expirationTime\" : {"
- " \"seconds\" : 1466597082,"
- " \"nanos\" : 552743000 "
- " },"
+ " \"publishTime\" : \"2016-06-30T11:01:37.000Z\","
+ " \"expirationTime\" : \"2016-07-01T11:01:37.000Z\","
" \"publisherName\" : \"Foo News\","
" \"imageUrl\" : \"http://localhost/foobar.jpg\","
" \"ampUrl\" : \"http://localhost/amp\","
@@ -45,7 +39,7 @@ TEST(NTPSnippetTest, FromChromeContentSuggestionsDictionary) {
EXPECT_EQ(snippet->salient_image_url(), GURL("http://localhost/foobar.jpg"));
auto unix_publish_date = snippet->publish_date() - base::Time::UnixEpoch();
auto expiry_duration = snippet->expiry_date() - snippet->publish_date();
- EXPECT_FLOAT_EQ(unix_publish_date.InSecondsF(), 1466510682.552743f);
+ EXPECT_FLOAT_EQ(unix_publish_date.InSecondsF(), 1467284497.000000f);
EXPECT_FLOAT_EQ(expiry_duration.InSecondsF(), 86400.000000f);
EXPECT_EQ(snippet->best_source().publisher_name, "Foo News");
« no previous file with comments | « components/ntp_snippets/ntp_snippet.cc ('k') | components/ntp_snippets/ntp_snippets_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698