| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <map> | 5 #include <map> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 3132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3143 }; | 3143 }; |
| 3144 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 3144 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 3145 for (size_t i = 0; i < arraysize(kSupportedCardIdrs); ++i) { | 3145 for (size_t i = 0; i < arraysize(kSupportedCardIdrs); ++i) { |
| 3146 SCOPED_TRACE(base::IntToString(i)); | 3146 SCOPED_TRACE(base::IntToString(i)); |
| 3147 gfx::Image supported_card_icon = rb.GetImageNamed(kSupportedCardIdrs[i]); | 3147 gfx::Image supported_card_icon = rb.GetImageNamed(kSupportedCardIdrs[i]); |
| 3148 EXPECT_GE(placeholder_icon.Width(), supported_card_icon.Width()); | 3148 EXPECT_GE(placeholder_icon.Width(), supported_card_icon.Width()); |
| 3149 EXPECT_GE(placeholder_icon.Height(), supported_card_icon.Height()); | 3149 EXPECT_GE(placeholder_icon.Height(), supported_card_icon.Height()); |
| 3150 } | 3150 } |
| 3151 } | 3151 } |
| 3152 | 3152 |
| 3153 TEST_F(AutofillDialogControllerTest, NoPartiallySupportedCountriesSuggested) { | |
| 3154 SwitchToAutofill(); | |
| 3155 | |
| 3156 std::string partially_supported_country = "KR"; | |
| 3157 ASSERT_FALSE(i18ninput::CountryIsFullySupported(partially_supported_country)); | |
| 3158 ASSERT_FALSE(controller()->MenuModelForSection(SECTION_BILLING)); | |
| 3159 | |
| 3160 AutofillProfile verified_profile(test::GetVerifiedProfile()); | |
| 3161 verified_profile.SetRawInfo(ADDRESS_HOME_COUNTRY, | |
| 3162 ASCIIToUTF16(partially_supported_country)); | |
| 3163 controller()->GetTestingManager()->AddTestingProfile(&verified_profile); | |
| 3164 | |
| 3165 EXPECT_FALSE( | |
| 3166 controller()->SuggestionStateForSection(SECTION_BILLING).visible); | |
| 3167 } | |
| 3168 | |
| 3169 TEST_F(AutofillDialogControllerTest, CountryChangeUpdatesSection) { | 3153 TEST_F(AutofillDialogControllerTest, CountryChangeUpdatesSection) { |
| 3170 TestAutofillDialogView* view = controller()->GetView(); | 3154 TestAutofillDialogView* view = controller()->GetView(); |
| 3171 view->ClearSectionUpdates(); | 3155 view->ClearSectionUpdates(); |
| 3172 | 3156 |
| 3173 controller()->UserEditedOrActivatedInput(SECTION_SHIPPING, | 3157 controller()->UserEditedOrActivatedInput(SECTION_SHIPPING, |
| 3174 ADDRESS_HOME_COUNTRY, | 3158 ADDRESS_HOME_COUNTRY, |
| 3175 gfx::NativeView(), | 3159 gfx::NativeView(), |
| 3176 gfx::Rect(), | 3160 gfx::Rect(), |
| 3177 ASCIIToUTF16("Belarus"), | 3161 ASCIIToUTF16("Belarus"), |
| 3178 true); | 3162 true); |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3528 controller()->MenuModelForSection(SECTION_CC_BILLING)->ActivatedAt(2); | 3512 controller()->MenuModelForSection(SECTION_CC_BILLING)->ActivatedAt(2); |
| 3529 | 3513 |
| 3530 FieldValueMap outputs; | 3514 FieldValueMap outputs; |
| 3531 outputs[NAME_FULL] = ASCIIToUTF16("madonna"); | 3515 outputs[NAME_FULL] = ASCIIToUTF16("madonna"); |
| 3532 controller()->GetView()->SetUserInput(SECTION_CC_BILLING, outputs); | 3516 controller()->GetView()->SetUserInput(SECTION_CC_BILLING, outputs); |
| 3533 | 3517 |
| 3534 ASSERT_NO_FATAL_FAILURE(SwitchToAutofill()); | 3518 ASSERT_NO_FATAL_FAILURE(SwitchToAutofill()); |
| 3535 } | 3519 } |
| 3536 | 3520 |
| 3537 } // namespace autofill | 3521 } // namespace autofill |
| OLD | NEW |