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

Unified Diff: ios/chrome/browser/ui/collection_view/collection_view_controller_unittest.mm

Issue 2761263003: Allow CollectionViewModel/Controller queries without SectionIdentifier (Closed)
Patch Set: Cleanup Created 3 years, 8 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
Index: ios/chrome/browser/ui/collection_view/collection_view_controller_unittest.mm
diff --git a/ios/chrome/browser/ui/collection_view/collection_view_controller_unittest.mm b/ios/chrome/browser/ui/collection_view/collection_view_controller_unittest.mm
index aaaeeb9175a19f12ce0a38fccd0f69043e1e764b..ef989a570956f2c2e122eac4f0ceebb6677bc725 100644
--- a/ios/chrome/browser/ui/collection_view/collection_view_controller_unittest.mm
+++ b/ios/chrome/browser/ui/collection_view/collection_view_controller_unittest.mm
@@ -44,9 +44,7 @@ typedef NS_ENUM(NSInteger, ItemType) {
ItemTypeFooBiz,
};
-typedef void (^ReconfigureBlock)(CollectionViewController*,
- NSArray*,
- SectionIdentifier);
+typedef void (^ReconfigureBlock)(CollectionViewController*, NSArray*);
class CollectionViewControllerTest : public BlockCleanupTest {
public:
@@ -99,7 +97,7 @@ class CollectionViewControllerTest : public BlockCleanupTest {
firstReconfiguredItem, secondReconfiguredItem, thirdReconfiguredItem
];
// Action.
- block(controller, itemsToReconfigure, SectionIdentifierFoo);
+ block(controller, itemsToReconfigure);
}
// Tests.
@@ -145,30 +143,26 @@ TEST_F(CollectionViewControllerTest, CellForItemAtIndexPath) {
}
TEST_F(CollectionViewControllerTest, ReconfigureCells) {
- TestReconfigureBlock(^void(CollectionViewController* controller,
- NSArray* itemsToReconfigure,
- SectionIdentifier sectionIdentifier) {
- [controller reconfigureCellsForItems:itemsToReconfigure
- inSectionWithIdentifier:sectionIdentifier];
- });
+ TestReconfigureBlock(
+ ^void(CollectionViewController* controller, NSArray* itemsToReconfigure) {
+ [controller reconfigureCellsForItems:itemsToReconfigure];
+ });
}
TEST_F(CollectionViewControllerTest, ReconfigureCellsWithIndexPath) {
- TestReconfigureBlock(^void(CollectionViewController* controller,
- NSArray* itemsToReconfigure,
- SectionIdentifier sectionIdentifier) {
- // More setup.
- NSMutableArray* indexPaths = [NSMutableArray array];
- for (CollectionViewItem* item : itemsToReconfigure) {
- NSIndexPath* indexPath =
- [controller.collectionViewModel indexPathForItem:item
- inSectionWithIdentifier:sectionIdentifier];
- if (indexPath) {
- [indexPaths addObject:indexPath];
- }
- }
-
- // Action.
- [controller reconfigureCellsAtIndexPaths:indexPaths];
- });
+ TestReconfigureBlock(
+ ^void(CollectionViewController* controller, NSArray* itemsToReconfigure) {
+ // More setup.
+ NSMutableArray* indexPaths = [NSMutableArray array];
+ for (CollectionViewItem* item : itemsToReconfigure) {
+ NSIndexPath* indexPath =
+ [controller.collectionViewModel indexPathForItem:item];
+ if (indexPath) {
+ [indexPaths addObject:indexPath];
+ }
+ }
+
+ // Action.
+ [controller reconfigureCellsAtIndexPaths:indexPaths];
+ });
}

Powered by Google App Engine
This is Rietveld 408576698