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

Side by Side 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: Rename function post-rebase 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 unified diff | Download patch
OLDNEW
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 #include "components/autofill/core/browser/region_combobox_model.h" 5 #include "components/autofill/core/browser/region_combobox_model.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 std::unique_ptr<RegionComboboxModel> model_; 87 std::unique_ptr<RegionComboboxModel> model_;
88 }; 88 };
89 89
90 // Make sure the two regions returned by the source are properly set in the 90 // Make sure the two regions returned by the source are properly set in the
91 // model. 91 // model.
92 TEST_F(RegionComboboxModelTest, QuebecOntarioRegions) { 92 TEST_F(RegionComboboxModelTest, QuebecOntarioRegions) {
93 SetupCombobox(false); 93 SetupCombobox(false);
94 EXPECT_EQ(2, model()->GetItemCount()); 94 EXPECT_EQ(2, model()->GetItemCount());
95 EXPECT_EQ(base::ASCIIToUTF16(kQuebec), model()->GetItemAt(0)); 95 EXPECT_EQ(base::ASCIIToUTF16(kQuebec), model()->GetItemAt(0));
96 EXPECT_EQ(base::ASCIIToUTF16(kOntario), model()->GetItemAt(1)); 96 EXPECT_EQ(base::ASCIIToUTF16(kOntario), model()->GetItemAt(1));
97 EXPECT_FALSE(model()->failed_to_load_data());
97 } 98 }
98 99
99 // Make sure the combo box properly support source failures. 100 // Make sure the combo box properly support source failures.
100 TEST_F(RegionComboboxModelTest, FailingSource) { 101 TEST_F(RegionComboboxModelTest, FailingSource) {
101 SetupCombobox(true); 102 SetupCombobox(true);
102 EXPECT_EQ(0, model()->GetItemCount()); 103 EXPECT_EQ(1, model()->GetItemCount());
104 EXPECT_TRUE(model()->failed_to_load_data());
103 } 105 }
104 106
105 } // namespace autofill 107 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698