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

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

Issue 2710683012: [Payment Request] Payment request summary view pending state (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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/shipping_address_selection_view_controller. h" 5 #import "ios/chrome/browser/payments/shipping_address_selection_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/test_personal_data_manager.h" 10 #include "components/autofill/core/browser/test_personal_data_manager.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 item = GetCollectionViewItem(0, 3); 94 item = GetCollectionViewItem(0, 3);
95 EXPECT_TRUE([item isMemberOfClass:[PaymentsTextItem class]]); 95 EXPECT_TRUE([item isMemberOfClass:[PaymentsTextItem class]]);
96 96
97 // Test the error state. 97 // Test the error state.
98 [GetShippingAddressSelectionViewController() setErrorMessage:@"Lorem ipsum"]; 98 [GetShippingAddressSelectionViewController() setErrorMessage:@"Lorem ipsum"];
99 [GetShippingAddressSelectionViewController() loadModel]; 99 [GetShippingAddressSelectionViewController() loadModel];
100 ASSERT_EQ(1, NumberOfSections()); 100 ASSERT_EQ(1, NumberOfSections());
101 // There should stil be 4 items in total. 101 // There should stil be 4 items in total.
102 ASSERT_EQ(4U, static_cast<unsigned int>(NumberOfItemsInSection(0))); 102 ASSERT_EQ(4U, static_cast<unsigned int>(NumberOfItemsInSection(0)));
103 103
104 // Test the loading state. 104 // Test the pending state.
105 [GetShippingAddressSelectionViewController() setIsLoading:YES]; 105 [GetShippingAddressSelectionViewController() setPending:YES];
106 [GetShippingAddressSelectionViewController() loadModel]; 106 [GetShippingAddressSelectionViewController() loadModel];
107 107
108 ASSERT_EQ(1, NumberOfSections()); 108 ASSERT_EQ(1, NumberOfSections());
109 // There should be only one item. 109 // There should be only one item.
110 ASSERT_EQ(1U, static_cast<unsigned int>(NumberOfItemsInSection(0))); 110 ASSERT_EQ(1U, static_cast<unsigned int>(NumberOfItemsInSection(0)));
111 111
112 // The item should be of type StatusItem. 112 // The item should be of type StatusItem.
113 item = GetCollectionViewItem(0, 0); 113 item = GetCollectionViewItem(0, 0);
114 EXPECT_TRUE([item isMemberOfClass:[StatusItem class]]); 114 EXPECT_TRUE([item isMemberOfClass:[StatusItem class]]);
115 } 115 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698