| OLD | NEW |
| 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/shipping_option_selection_view_controller.h
" | 5 #import "ios/chrome/browser/payments/shipping_option_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 "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "components/autofill/core/browser/test_personal_data_manager.h" | 10 #include "components/autofill/core/browser/test_personal_data_manager.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 [GetShippingOptionSelectionViewController() loadModel]; | 76 [GetShippingOptionSelectionViewController() loadModel]; |
| 77 | 77 |
| 78 ASSERT_EQ(1, NumberOfSections()); | 78 ASSERT_EQ(1, NumberOfSections()); |
| 79 // There should be 3 items now in total. | 79 // There should be 3 items now in total. |
| 80 ASSERT_EQ(3U, static_cast<unsigned int>(NumberOfItemsInSection(0))); | 80 ASSERT_EQ(3U, static_cast<unsigned int>(NumberOfItemsInSection(0))); |
| 81 | 81 |
| 82 // The first item should also be of type TextAndMessageItem. | 82 // The first item should also be of type TextAndMessageItem. |
| 83 item = GetCollectionViewItem(0, 0); | 83 item = GetCollectionViewItem(0, 0); |
| 84 EXPECT_TRUE([item isMemberOfClass:[PaymentsTextItem class]]); | 84 EXPECT_TRUE([item isMemberOfClass:[PaymentsTextItem class]]); |
| 85 | 85 |
| 86 // Test the loading state. | 86 // Test the pending state. |
| 87 [GetShippingOptionSelectionViewController() setIsLoading:YES]; | 87 [GetShippingOptionSelectionViewController() setIsPending:YES]; |
| 88 [GetShippingOptionSelectionViewController() loadModel]; | 88 [GetShippingOptionSelectionViewController() loadModel]; |
| 89 | 89 |
| 90 ASSERT_EQ(1, NumberOfSections()); | 90 ASSERT_EQ(1, NumberOfSections()); |
| 91 // There should be only one item. | 91 // There should be only one item. |
| 92 ASSERT_EQ(1U, static_cast<unsigned int>(NumberOfItemsInSection(0))); | 92 ASSERT_EQ(1U, static_cast<unsigned int>(NumberOfItemsInSection(0))); |
| 93 | 93 |
| 94 // The item should be of type StatusItem. | 94 // The item should be of type StatusItem. |
| 95 item = GetCollectionViewItem(0, 0); | 95 item = GetCollectionViewItem(0, 0); |
| 96 EXPECT_TRUE([item isMemberOfClass:[StatusItem class]]); | 96 EXPECT_TRUE([item isMemberOfClass:[StatusItem class]]); |
| 97 } | 97 } |
| OLD | NEW |