OLD | NEW |
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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 item = GetCollectionViewItem(0, 3); | 90 item = GetCollectionViewItem(0, 3); |
91 EXPECT_TRUE([item isMemberOfClass:[PaymentsTextItem class]]); | 91 EXPECT_TRUE([item isMemberOfClass:[PaymentsTextItem class]]); |
92 | 92 |
93 // Test the error state. | 93 // Test the error state. |
94 [GetShippingAddressSelectionViewController() setErrorMessage:@"Lorem ipsum"]; | 94 [GetShippingAddressSelectionViewController() setErrorMessage:@"Lorem ipsum"]; |
95 [GetShippingAddressSelectionViewController() loadModel]; | 95 [GetShippingAddressSelectionViewController() loadModel]; |
96 ASSERT_EQ(1, NumberOfSections()); | 96 ASSERT_EQ(1, NumberOfSections()); |
97 // There should stil be 4 items in total. | 97 // There should stil be 4 items in total. |
98 ASSERT_EQ(4U, static_cast<unsigned int>(NumberOfItemsInSection(0))); | 98 ASSERT_EQ(4U, static_cast<unsigned int>(NumberOfItemsInSection(0))); |
99 | 99 |
100 // Test the loading state. | 100 // Test the pending state. |
101 [GetShippingAddressSelectionViewController() setIsLoading:YES]; | 101 [GetShippingAddressSelectionViewController() setIsPending:YES]; |
102 [GetShippingAddressSelectionViewController() loadModel]; | 102 [GetShippingAddressSelectionViewController() loadModel]; |
103 | 103 |
104 ASSERT_EQ(1, NumberOfSections()); | 104 ASSERT_EQ(1, NumberOfSections()); |
105 // There should be only one item. | 105 // There should be only one item. |
106 ASSERT_EQ(1U, static_cast<unsigned int>(NumberOfItemsInSection(0))); | 106 ASSERT_EQ(1U, static_cast<unsigned int>(NumberOfItemsInSection(0))); |
107 | 107 |
108 // The item should be of type StatusItem. | 108 // The item should be of type StatusItem. |
109 item = GetCollectionViewItem(0, 0); | 109 item = GetCollectionViewItem(0, 0); |
110 EXPECT_TRUE([item isMemberOfClass:[StatusItem class]]); | 110 EXPECT_TRUE([item isMemberOfClass:[StatusItem class]]); |
111 } | 111 } |
OLD | NEW |