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

Side by Side Diff: ios/chrome/browser/ui/reading_list/reading_list_collection_view_controller_unittest.mm

Issue 2707043002: [Reading List iOS] Store distillation date and size. (Closed)
Patch Set: done Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/reading_list/url_downloader_unittest.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/chrome/browser/ui/reading_list/reading_list_collection_view_control ler.h" 5 #import "ios/chrome/browser/ui/reading_list/reading_list_collection_view_control ler.h"
6 6
7 #include <unordered_set> 7 #include <unordered_set>
8 8
9 #import "base/mac/foundation_util.h" 9 #import "base/mac/foundation_util.h"
10 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // items. 203 // items.
204 TEST_F(ReadingListCollectionViewControllerTest, 204 TEST_F(ReadingListCollectionViewControllerTest,
205 TestItemInitializationDistilled) { 205 TestItemInitializationDistilled) {
206 // Setup. 206 // Setup.
207 GURL url("https://chromium.org"); 207 GURL url("https://chromium.org");
208 std::string title("Chromium"); 208 std::string title("Chromium");
209 GURL distilled_url("https://chromium.org/distilled"); 209 GURL distilled_url("https://chromium.org/distilled");
210 base::FilePath distilled_path("/distilled/path"); 210 base::FilePath distilled_path("/distilled/path");
211 reading_list_model_->AddEntry(url, title, 211 reading_list_model_->AddEntry(url, title,
212 reading_list::ADDED_VIA_CURRENT_APP); 212 reading_list::ADDED_VIA_CURRENT_APP);
213 reading_list_model_->SetEntryDistilledInfo(url, distilled_path, 213 int64_t size = 50;
214 distilled_url); 214 reading_list_model_->SetEntryDistilledInfo(url, distilled_path, distilled_url,
215 size, 100);
215 // Load view. 216 // Load view.
216 [reading_list_view_controller_ view]; 217 [reading_list_view_controller_ view];
217 DCHECK([reading_list_view_controller_.get().collectionView 218 DCHECK([reading_list_view_controller_.get().collectionView
218 numberOfItemsInSection:0] == 1); 219 numberOfItemsInSection:0] == 1);
219 NSIndexPath* indexPath = [NSIndexPath indexPathForItem:0 inSection:0]; 220 NSIndexPath* indexPath = [NSIndexPath indexPathForItem:0 inSection:0];
220 ReadingListCollectionViewItem* readingListItem = 221 ReadingListCollectionViewItem* readingListItem =
221 base::mac::ObjCCastStrict<ReadingListCollectionViewItem>( 222 base::mac::ObjCCastStrict<ReadingListCollectionViewItem>(
222 [[reading_list_view_controller_ collectionViewModel] 223 [[reading_list_view_controller_ collectionViewModel]
223 itemAtIndexPath:indexPath]); 224 itemAtIndexPath:indexPath]);
224 EXPECT_EQ(base::SysNSStringToUTF8([readingListItem text]), title); 225 EXPECT_EQ(base::SysNSStringToUTF8([readingListItem text]), title);
225 EXPECT_EQ([readingListItem url], url); 226 EXPECT_EQ([readingListItem url], url);
226 EXPECT_EQ(base::SysNSStringToUTF16([readingListItem detailText]), 227 EXPECT_EQ(base::SysNSStringToUTF16([readingListItem detailText]),
227 url_formatter::FormatUrl(url)); 228 url_formatter::FormatUrl(url));
228 EXPECT_EQ([readingListItem faviconPageURL], distilled_url); 229 EXPECT_EQ([readingListItem faviconPageURL], distilled_url);
229 EXPECT_EQ([readingListItem distillationState], ReadingListEntry::PROCESSED); 230 EXPECT_EQ([readingListItem distillationState], ReadingListEntry::PROCESSED);
230 } 231 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/reading_list/url_downloader_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698