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

Unified Diff: components/reading_list/ios/reading_list_entry_unittest.cc

Issue 2592043002: Add title update merge logic to reading list entry (Closed)
Patch Set: Update function comment Created 4 years 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: components/reading_list/ios/reading_list_entry_unittest.cc
diff --git a/components/reading_list/ios/reading_list_entry_unittest.cc b/components/reading_list/ios/reading_list_entry_unittest.cc
index bf9dec3986a62ed8970a7e7ce9d65e90988f887f..84bcf5d45febb4f108d0d6376347d12875a1c2b5 100644
--- a/components/reading_list/ios/reading_list_entry_unittest.cc
+++ b/components/reading_list/ios/reading_list_entry_unittest.cc
@@ -5,6 +5,7 @@
#include "components/reading_list/ios/reading_list_entry.h"
#include "base/memory/ptr_util.h"
+#include "base/test/ios/wait_util.h"
#include "base/test/simple_test_tick_clock.h"
#include "components/reading_list/ios/proto/reading_list.pb.h"
#include "components/sync/protocol/reading_list_specifics.pb.h"
@@ -56,6 +57,18 @@ TEST(ReadingListEntry, ReadState) {
EXPECT_TRUE(e.IsRead());
}
+TEST(ReadingListEntry, UpdateTitle) {
+ ReadingListEntry e(GURL("http://example.com"), "bar");
+ ASSERT_EQ("bar", e.Title());
+ ASSERT_EQ(e.CreationTime(), e.UpdateTitleTime());
+
+ base::test::ios::SpinRunLoopWithMinDelay(
+ base::TimeDelta::FromMilliseconds(5));
+ e.SetTitle("foo");
+ EXPECT_GT(e.UpdateTitleTime(), e.CreationTime());
+ EXPECT_EQ("foo", e.Title());
+}
+
TEST(ReadingListEntry, DistilledPathAndURL) {
ReadingListEntry e(GURL("http://example.com"), "bar");

Powered by Google App Engine
This is Rietveld 408576698