| Index: components/reading_list/ios/reading_list_model_unittest.mm
|
| diff --git a/components/reading_list/ios/reading_list_model_unittest.mm b/components/reading_list/ios/reading_list_model_unittest.mm
|
| index d92b042518d9a962183b498f20a203b41cb9332b..bbdb4c91deed32143e2873dc42307cb21292b3b2 100644
|
| --- a/components/reading_list/ios/reading_list_model_unittest.mm
|
| +++ b/components/reading_list/ios/reading_list_model_unittest.mm
|
| @@ -683,4 +683,18 @@ TEST_F(ReadingListModelTest, CallbackModelBeingDeleted) {
|
| AssertObserverCount(1, 0, 0, 1, 0, 0, 0, 0, 0);
|
| }
|
|
|
| +// Tests that new line characters and spaces are collapsed in title.
|
| +TEST_F(ReadingListModelTest, TestTrimmingTitle) {
|
| + const GURL gurl("http://example.com");
|
| + std::string title = "\n This\ttitle \n contains new line \n characters ";
|
| + model_->AddEntry(gurl, title, reading_list::ADDED_VIA_CURRENT_APP);
|
| + model_->SetReadStatus(gurl, true);
|
| + const ReadingListEntry* entry = model_->GetEntryByURL(gurl);
|
| + EXPECT_EQ(entry->Title(), "This title contains new line characters");
|
| + model_->SetEntryTitle(gurl, "test");
|
| + EXPECT_EQ(entry->Title(), "test");
|
| + model_->SetEntryTitle(gurl, title);
|
| + EXPECT_EQ(entry->Title(), "This title contains new line characters");
|
| +}
|
| +
|
| } // namespace
|
|
|