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

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

Issue 2701923003: [Payment Request] Error message screen (Closed)
Patch Set: ARCified Created 3 years, 10 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_coordinator.h" 5 #import "ios/chrome/browser/payments/payment_request_coordinator.h"
6 6
7 #include "base/mac/foundation_util.h" 7 #include "base/mac/foundation_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/test/ios/wait_util.h" 9 #include "base/test/ios/wait_util.h"
10 #include "components/autofill/core/browser/autofill_profile.h" 10 #include "components/autofill/core/browser/autofill_profile.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 ScopedKeyWindow scoped_key_window_; 77 ScopedKeyWindow scoped_key_window_;
78 [scoped_key_window_.Get() setRootViewController:base_view_controller]; 78 [scoped_key_window_.Get() setRootViewController:base_view_controller];
79 79
80 PaymentRequestCoordinator* coordinator = [[[PaymentRequestCoordinator alloc] 80 PaymentRequestCoordinator* coordinator = [[[PaymentRequestCoordinator alloc]
81 initWithBaseViewController:base_view_controller] autorelease]; 81 initWithBaseViewController:base_view_controller] autorelease];
82 [coordinator setPaymentRequest:payment_request.get()]; 82 [coordinator setPaymentRequest:payment_request.get()];
83 83
84 [coordinator start]; 84 [coordinator start];
85 // Short delay to allow animation to complete. 85 // Short delay to allow animation to complete.
86 base::test::ios::SpinRunLoopWithMaxDelay(base::TimeDelta::FromSecondsD(1)); 86 base::test::ios::SpinRunLoopWithMaxDelay(base::TimeDelta::FromSecondsD(1));
87 id persented_view_controller = 87 id presented_view_controller =
88 [coordinator baseViewController].presentedViewController; 88 [coordinator baseViewController].presentedViewController;
89 EXPECT_TRUE([persented_view_controller 89 EXPECT_TRUE([presented_view_controller
90 isMemberOfClass:[UINavigationController class]]); 90 isMemberOfClass:[UINavigationController class]]);
91 UINavigationController* navigation_controller = 91 UINavigationController* navigation_controller =
92 base::mac::ObjCCastStrict<UINavigationController>( 92 base::mac::ObjCCastStrict<UINavigationController>(
93 persented_view_controller); 93 presented_view_controller);
94 EXPECT_EQ(1u, navigation_controller.viewControllers.count); 94 EXPECT_EQ(1u, navigation_controller.viewControllers.count);
95 id view_controller = navigation_controller.visibleViewController; 95 id view_controller = navigation_controller.visibleViewController;
96 EXPECT_TRUE( 96 EXPECT_TRUE(
97 [view_controller isMemberOfClass:[PaymentRequestViewController class]]); 97 [view_controller isMemberOfClass:[PaymentRequestViewController class]]);
98 98
99 [coordinator stop]; 99 [coordinator stop];
100 // Delay to allow animation to complete. 100 // Delay to allow animation to complete.
101 base::test::ios::SpinRunLoopWithMinDelay(base::TimeDelta::FromSecondsD(2)); 101 base::test::ios::SpinRunLoopWithMinDelay(base::TimeDelta::FromSecondsD(2));
102 102
103 EXPECT_EQ(nil, [coordinator baseViewController].presentedViewController); 103 EXPECT_EQ(nil, [coordinator baseViewController].presentedViewController);
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 }]; 270 }];
271 [coordinator setDelegate:delegate_mock]; 271 [coordinator setDelegate:delegate_mock];
272 272
273 [coordinator start]; 273 [coordinator start];
274 // Short delay to allow animation to complete. 274 // Short delay to allow animation to complete.
275 base::test::ios::SpinRunLoopWithMaxDelay(base::TimeDelta::FromSecondsD(1)); 275 base::test::ios::SpinRunLoopWithMaxDelay(base::TimeDelta::FromSecondsD(1));
276 276
277 // Call the controller delegate method. 277 // Call the controller delegate method.
278 [coordinator paymentRequestViewControllerDidCancel:nil]; 278 [coordinator paymentRequestViewControllerDidCancel:nil];
279 } 279 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698