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

Unified Diff: components/autofill/core/browser/region_combobox_model_unittest.cc

Issue 2803443003: [Payments] Added region load failure tolerance and tests to PR editor. (Closed)
Patch Set: Removed unneeded include. Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/region_combobox_model_unittest.cc
diff --git a/components/autofill/core/browser/region_combobox_model_unittest.cc b/components/autofill/core/browser/region_combobox_model_unittest.cc
index f749e6593f833d13e79e8d52021bcd544840e690..52878f0e921d34ace135868763c2c86809c589f4 100644
--- a/components/autofill/core/browser/region_combobox_model_unittest.cc
+++ b/components/autofill/core/browser/region_combobox_model_unittest.cc
@@ -34,8 +34,8 @@ class RegionComboboxModelTest : public testing::Test {
void SetupCombobox(bool source_failure) {
model_.reset(new RegionComboboxModel(
- base::WrapUnique(new TestSource(source_failure)),
- base::WrapUnique(new ::i18n::addressinput::NullStorage),
+ base::MakeUnique<TestSource>(source_failure),
+ base::MakeUnique<::i18n::addressinput::NullStorage>(),
manager_.app_locale(), kTestCountryCode));
}
@@ -94,12 +94,14 @@ TEST_F(RegionComboboxModelTest, QuebecOntarioRegions) {
EXPECT_EQ(2, model()->GetItemCount());
EXPECT_EQ(base::ASCIIToUTF16(kQuebec), model()->GetItemAt(0));
EXPECT_EQ(base::ASCIIToUTF16(kOntario), model()->GetItemAt(1));
+ EXPECT_FALSE(model()->failed_to_load_data());
}
// Make sure the combo box properly support source failures.
TEST_F(RegionComboboxModelTest, FailingSource) {
SetupCombobox(true);
- EXPECT_EQ(0, model()->GetItemCount());
+ EXPECT_EQ(1, model()->GetItemCount());
+ EXPECT_TRUE(model()->failed_to_load_data());
}
} // namespace autofill
« no previous file with comments | « components/autofill/core/browser/region_combobox_model.cc ('k') | components/payments/content/payment_request_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698