| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/payments/payment_request_selector_view_controller
.h" | 5 #import "ios/chrome/browser/ui/payments/payment_request_selector_view_controller
.h" |
| 6 | 6 |
| 7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
| 8 #import "ios/chrome/browser/ui/autofill/cells/status_item.h" | 8 #import "ios/chrome/browser/ui/autofill/cells/status_item.h" |
| 9 #import "ios/chrome/browser/ui/collection_view/collection_view_controller_test.h
" | 9 #import "ios/chrome/browser/ui/collection_view/collection_view_controller_test.h
" |
| 10 #import "ios/chrome/browser/ui/payments/cells/payments_text_item.h" | 10 #import "ios/chrome/browser/ui/payments/cells/payments_text_item.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 if (self) { | 35 if (self) { |
| 36 _items = | 36 _items = |
| 37 @[ [[PaymentsTextItem alloc] init], [[PaymentsTextItem alloc] init] ]; | 37 @[ [[PaymentsTextItem alloc] init], [[PaymentsTextItem alloc] init] ]; |
| 38 _selectedItemIndex = 0; | 38 _selectedItemIndex = 0; |
| 39 } | 39 } |
| 40 return self; | 40 return self; |
| 41 } | 41 } |
| 42 | 42 |
| 43 #pragma mark - PaymentRequestSelectorViewControllerDataSource | 43 #pragma mark - PaymentRequestSelectorViewControllerDataSource |
| 44 | 44 |
| 45 - (BOOL)allowsEditMode { |
| 46 return NO; |
| 47 } |
| 48 |
| 45 - (CollectionViewItem*)headerItem { | 49 - (CollectionViewItem*)headerItem { |
| 46 return [[CollectionViewItem alloc] init]; | 50 return [[CollectionViewItem alloc] init]; |
| 47 } | 51 } |
| 48 | 52 |
| 49 - (NSArray<CollectionViewItem*>*)selectableItems { | 53 - (NSArray<CollectionViewItem*>*)selectableItems { |
| 50 return _items; | 54 return _items; |
| 51 } | 55 } |
| 52 | 56 |
| 53 - (CollectionViewItem*)addButtonItem { | 57 - (CollectionViewItem*)addButtonItem { |
| 54 return [[CollectionViewItem alloc] init]; | 58 return [[CollectionViewItem alloc] init]; |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 [GetPaymentRequestSelectorViewController() loadModel]; | 126 [GetPaymentRequestSelectorViewController() loadModel]; |
| 123 | 127 |
| 124 ASSERT_EQ(1, NumberOfSections()); | 128 ASSERT_EQ(1, NumberOfSections()); |
| 125 // There should be only one item. | 129 // There should be only one item. |
| 126 ASSERT_EQ(1, NumberOfItemsInSection(0)); | 130 ASSERT_EQ(1, NumberOfItemsInSection(0)); |
| 127 | 131 |
| 128 // The item should be of type StatusItem. | 132 // The item should be of type StatusItem. |
| 129 id item = GetCollectionViewItem(0, 0); | 133 id item = GetCollectionViewItem(0, 0); |
| 130 EXPECT_TRUE([item isMemberOfClass:[StatusItem class]]); | 134 EXPECT_TRUE([item isMemberOfClass:[StatusItem class]]); |
| 131 } | 135 } |
| OLD | NEW |