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

Side by Side Diff: ios/chrome/browser/ui/payments/contact_info_edit_mediator_unittest.mm

Issue 2965073002: [Payment Request] Moves PaymentRequest into the payments namespace (Closed)
Patch Set: rebase Created 3 years, 5 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/ui/payments/contact_info_edit_mediator.h" 5 #import "ios/chrome/browser/ui/payments/contact_info_edit_mediator.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 "base/test/scoped_task_environment.h" 9 #include "base/test/scoped_task_environment.h"
10 #include "components/autofill/core/browser/autofill_profile.h" 10 #include "components/autofill/core/browser/autofill_profile.h"
(...skipping 11 matching lines...) Expand all
22 #include "third_party/ocmock/gtest_support.h" 22 #include "third_party/ocmock/gtest_support.h"
23 #include "ui/base/l10n/l10n_util.h" 23 #include "ui/base/l10n/l10n_util.h"
24 24
25 #if !defined(__has_feature) || !__has_feature(objc_arc) 25 #if !defined(__has_feature) || !__has_feature(objc_arc)
26 #error "This file requires ARC support." 26 #error "This file requires ARC support."
27 #endif 27 #endif
28 28
29 class PaymentRequestContactInfoEditMediatorTest : public PlatformTest { 29 class PaymentRequestContactInfoEditMediatorTest : public PlatformTest {
30 protected: 30 protected:
31 PaymentRequestContactInfoEditMediatorTest() 31 PaymentRequestContactInfoEditMediatorTest()
32 : payment_request_(base::MakeUnique<TestPaymentRequest>( 32 : payment_request_(base::MakeUnique<payments::TestPaymentRequest>(
33 payment_request_test_util::CreateTestWebPaymentRequest(), 33 payment_request_test_util::CreateTestWebPaymentRequest(),
34 &personal_data_manager_)) {} 34 &personal_data_manager_)) {}
35 35
36 base::test::ScopedTaskEnvironment scoped_task_evironment_; 36 base::test::ScopedTaskEnvironment scoped_task_evironment_;
37 37
38 autofill::TestPersonalDataManager personal_data_manager_; 38 autofill::TestPersonalDataManager personal_data_manager_;
39 std::unique_ptr<TestPaymentRequest> payment_request_; 39 std::unique_ptr<payments::TestPaymentRequest> payment_request_;
40 }; 40 };
41 41
42 // Tests that the expected editor fields are created when creating a profile. 42 // Tests that the expected editor fields are created when creating a profile.
43 TEST_F(PaymentRequestContactInfoEditMediatorTest, TestFieldsWhenCreate) { 43 TEST_F(PaymentRequestContactInfoEditMediatorTest, TestFieldsWhenCreate) {
44 id check_block = ^BOOL(id value) { 44 id check_block = ^BOOL(id value) {
45 EXPECT_TRUE([value isKindOfClass:[NSArray class]]); 45 EXPECT_TRUE([value isKindOfClass:[NSArray class]]);
46 NSArray* fields = base::mac::ObjCCastStrict<NSArray>(value); 46 NSArray* fields = base::mac::ObjCCastStrict<NSArray>(value);
47 EXPECT_EQ(3U, fields.count); 47 EXPECT_EQ(3U, fields.count);
48 48
49 id field = fields[0]; 49 id field = fields[0];
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 [OCMockObject mockForProtocol:@protocol(PaymentRequestEditConsumer)]; 193 [OCMockObject mockForProtocol:@protocol(PaymentRequestEditConsumer)];
194 [[consumer expect] setEditorFields:[OCMArg checkWithBlock:check_block]]; 194 [[consumer expect] setEditorFields:[OCMArg checkWithBlock:check_block]];
195 195
196 ContactInfoEditMediator* mediator = [[ContactInfoEditMediator alloc] 196 ContactInfoEditMediator* mediator = [[ContactInfoEditMediator alloc]
197 initWithPaymentRequest:payment_request_.get() 197 initWithPaymentRequest:payment_request_.get()
198 profile:nil]; 198 profile:nil];
199 [mediator setConsumer:consumer]; 199 [mediator setConsumer:consumer];
200 200
201 EXPECT_OCMOCK_VERIFY(consumer); 201 EXPECT_OCMOCK_VERIFY(consumer);
202 } 202 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698