| 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/payments/credit_card_edit_view_controller.h" | 5 #import "ios/chrome/browser/payments/credit_card_edit_view_controller.h" |
| 6 | 6 |
| 7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "components/autofill/core/browser/field_types.h" | 9 #include "components/autofill/core/browser/field_types.h" |
| 10 #include "components/autofill/core/browser/test_personal_data_manager.h" | 10 #include "components/autofill/core/browser/test_personal_data_manager.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 value:@"2090" | 52 value:@"2090" |
| 53 required:YES], | 53 required:YES], |
| 54 ]; | 54 ]; |
| 55 } | 55 } |
| 56 | 56 |
| 57 @end | 57 @end |
| 58 | 58 |
| 59 class PaymentRequestCreditCardEditViewControllerTest | 59 class PaymentRequestCreditCardEditViewControllerTest |
| 60 : public CollectionViewControllerTest { | 60 : public CollectionViewControllerTest { |
| 61 protected: | 61 protected: |
| 62 CollectionViewController* NewController() override NS_RETURNS_RETAINED { | 62 CollectionViewController* InstantiateController() override { |
| 63 payment_request_ = base::MakeUnique<PaymentRequest>( | 63 payment_request_ = base::MakeUnique<PaymentRequest>( |
| 64 payment_request_test_util::CreateTestWebPaymentRequest(), | 64 payment_request_test_util::CreateTestWebPaymentRequest(), |
| 65 &personal_data_manager_); | 65 &personal_data_manager_); |
| 66 | 66 |
| 67 CreditCardEditViewControllerMediator* mediator = | 67 CreditCardEditViewControllerMediator* mediator = |
| 68 [[CreditCardEditViewControllerMediator alloc] | 68 [[CreditCardEditViewControllerMediator alloc] |
| 69 initWithPaymentRequest:payment_request_.get() | 69 initWithPaymentRequest:payment_request_.get() |
| 70 creditCard:nil]; | 70 creditCard:nil]; |
| 71 | 71 |
| 72 CreditCardEditViewController* viewController = | 72 CreditCardEditViewController* viewController = |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 ASSERT_EQ(7, NumberOfSections()); | 146 ASSERT_EQ(7, NumberOfSections()); |
| 147 | 147 |
| 148 // The switch section is the last section before the footer and has one item | 148 // The switch section is the last section before the footer and has one item |
| 149 // of the type CollectionViewSwitchItem. The switch is on by defualt. | 149 // of the type CollectionViewSwitchItem. The switch is on by defualt. |
| 150 ASSERT_EQ(1U, static_cast<unsigned int>(NumberOfItemsInSection(5))); | 150 ASSERT_EQ(1U, static_cast<unsigned int>(NumberOfItemsInSection(5))); |
| 151 id item = GetCollectionViewItem(5, 0); | 151 id item = GetCollectionViewItem(5, 0); |
| 152 EXPECT_TRUE([item isMemberOfClass:[CollectionViewSwitchItem class]]); | 152 EXPECT_TRUE([item isMemberOfClass:[CollectionViewSwitchItem class]]); |
| 153 CollectionViewSwitchItem* switch_item = item; | 153 CollectionViewSwitchItem* switch_item = item; |
| 154 EXPECT_EQ(YES, [switch_item isOn]); | 154 EXPECT_EQ(YES, [switch_item isOn]); |
| 155 } | 155 } |
| OLD | NEW |