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

Side by Side Diff: ios/chrome/browser/payments/payment_request_view_controller_unittest.mm

Issue 2716413002: [Payment Request] Replacing more iOS strings with components strings (Closed)
Patch Set: rebase Created 3 years, 9 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
OLDNEW
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/payment_request_view_controller.h" 5 #import "ios/chrome/browser/payments/payment_request_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/autofill_profile.h" 9 #include "components/autofill/core/browser/autofill_profile.h"
10 #include "components/autofill/core/browser/autofill_test_utils.h" 10 #include "components/autofill/core/browser/autofill_test_utils.h"
11 #include "components/autofill/core/browser/credit_card.h" 11 #include "components/autofill/core/browser/credit_card.h"
12 #include "components/autofill/core/browser/test_personal_data_manager.h" 12 #include "components/autofill/core/browser/test_personal_data_manager.h"
13 #include "components/strings/grit/components_strings.h"
13 #import "ios/chrome/browser/payments/cells/autofill_profile_item.h" 14 #import "ios/chrome/browser/payments/cells/autofill_profile_item.h"
14 #import "ios/chrome/browser/payments/cells/page_info_item.h" 15 #import "ios/chrome/browser/payments/cells/page_info_item.h"
15 #import "ios/chrome/browser/payments/cells/payment_method_item.h" 16 #import "ios/chrome/browser/payments/cells/payment_method_item.h"
16 #import "ios/chrome/browser/payments/cells/price_item.h" 17 #import "ios/chrome/browser/payments/cells/price_item.h"
17 #include "ios/chrome/browser/payments/payment_request.h" 18 #include "ios/chrome/browser/payments/payment_request.h"
18 #include "ios/chrome/browser/payments/payment_request_test_util.h" 19 #include "ios/chrome/browser/payments/payment_request_test_util.h"
19 #import "ios/chrome/browser/ui/autofill/cells/status_item.h" 20 #import "ios/chrome/browser/ui/autofill/cells/status_item.h"
20 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_detail_item .h" 21 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_detail_item .h"
21 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.h " 22 #import "ios/chrome/browser/ui/collection_view/cells/collection_view_text_item.h "
22 #import "ios/chrome/browser/ui/collection_view/collection_view_controller_test.h " 23 #import "ios/chrome/browser/ui/collection_view/collection_view_controller_test.h "
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 std::unique_ptr<autofill::AutofillProfile> profile_; 62 std::unique_ptr<autofill::AutofillProfile> profile_;
62 std::unique_ptr<autofill::CreditCard> credit_card_; 63 std::unique_ptr<autofill::CreditCard> credit_card_;
63 std::unique_ptr<PaymentRequest> payment_request_; 64 std::unique_ptr<PaymentRequest> payment_request_;
64 std::unique_ptr<autofill::TestPersonalDataManager> personal_data_manager_; 65 std::unique_ptr<autofill::TestPersonalDataManager> personal_data_manager_;
65 }; 66 };
66 67
67 // Tests that the correct items are displayed after loading the model. 68 // Tests that the correct items are displayed after loading the model.
68 TEST_F(PaymentRequestViewControllerTest, TestModel) { 69 TEST_F(PaymentRequestViewControllerTest, TestModel) {
69 CreateController(); 70 CreateController();
70 CheckController(); 71 CheckController();
71 CheckTitleWithId(IDS_IOS_PAYMENT_REQUEST_TITLE); 72 CheckTitleWithId(IDS_PAYMENTS_TITLE);
72 73
73 [GetPaymentRequestViewController() loadModel]; 74 [GetPaymentRequestViewController() loadModel];
74 75
75 // There should be three sections in total. Summary, Shipping, and Payment. 76 // There should be three sections in total. Summary, Shipping, and Payment.
76 ASSERT_EQ(4, NumberOfSections()); 77 ASSERT_EQ(4, NumberOfSections());
77 78
78 // The only item in the Summary section should be of type PriceItem. 79 // The only item in the Summary section should be of type PriceItem.
79 ASSERT_EQ(1U, static_cast<unsigned int>(NumberOfItemsInSection(0))); 80 ASSERT_EQ(1U, static_cast<unsigned int>(NumberOfItemsInSection(0)));
80 id item = GetCollectionViewItem(0, 0); 81 id item = GetCollectionViewItem(0, 0);
81 EXPECT_TRUE([item isMemberOfClass:[PriceItem class]]); 82 EXPECT_TRUE([item isMemberOfClass:[PriceItem class]]);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 [GetPaymentRequestViewController() loadModel]; 199 [GetPaymentRequestViewController() loadModel];
199 200
200 ASSERT_EQ(1, NumberOfSections()); 201 ASSERT_EQ(1, NumberOfSections());
201 // There should be only one item. 202 // There should be only one item.
202 ASSERT_EQ(1U, static_cast<unsigned int>(NumberOfItemsInSection(0))); 203 ASSERT_EQ(1U, static_cast<unsigned int>(NumberOfItemsInSection(0)));
203 204
204 // The item should be of type StatusItem. 205 // The item should be of type StatusItem.
205 id item = GetCollectionViewItem(0, 0); 206 id item = GetCollectionViewItem(0, 0);
206 EXPECT_TRUE([item isMemberOfClass:[StatusItem class]]); 207 EXPECT_TRUE([item isMemberOfClass:[StatusItem class]]);
207 } 208 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698