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

Side by Side Diff: chrome/browser/ui/autofill/data_model_wrapper_unittest.cc

Issue 85863003: Change DetailOutputMap to FieldValueMap (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/strings/string_number_conversions.h" 6 #include "base/strings/string_number_conversions.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/ui/autofill/autofill_dialog_models.h" 8 #include "chrome/browser/ui/autofill/autofill_dialog_models.h"
9 #include "chrome/browser/ui/autofill/data_model_wrapper.h" 9 #include "chrome/browser/ui/autofill/data_model_wrapper.h"
10 #include "components/autofill/content/browser/wallet/wallet_items.h" 10 #include "components/autofill/content/browser/wallet/wallet_items.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 EXPECT_EQ(national_formatted, 161 EXPECT_EQ(national_formatted,
162 profile_wrapper.GetInfoForDisplay( 162 profile_wrapper.GetInfoForDisplay(
163 AutofillType(PHONE_HOME_WHOLE_NUMBER))); 163 AutofillType(PHONE_HOME_WHOLE_NUMBER)));
164 profile.SetRawInfo(PHONE_HOME_WHOLE_NUMBER, user_formatted); 164 profile.SetRawInfo(PHONE_HOME_WHOLE_NUMBER, user_formatted);
165 EXPECT_EQ(user_formatted, 165 EXPECT_EQ(user_formatted,
166 profile_wrapper.GetInfoForDisplay( 166 profile_wrapper.GetInfoForDisplay(
167 AutofillType(PHONE_HOME_WHOLE_NUMBER))); 167 AutofillType(PHONE_HOME_WHOLE_NUMBER)));
168 168
169 } 169 }
170 170
171 TEST(DetailOutputWrapperTest, BothShippingAndBillingCanCoexist) { 171 TEST(FieldMapWrapperTest, BothShippingAndBillingCanCoexist) {
172 DetailInputs inputs; 172 DetailInputs inputs;
173 173
174 DetailInput billing_street; 174 DetailInput billing_street;
175 billing_street.type = ADDRESS_BILLING_STREET_ADDRESS; 175 billing_street.type = ADDRESS_BILLING_STREET_ADDRESS;
176 inputs.push_back(billing_street); 176 inputs.push_back(billing_street);
177 177
178 DetailInput shipping_street; 178 DetailInput shipping_street;
179 shipping_street.type = ADDRESS_HOME_STREET_ADDRESS; 179 shipping_street.type = ADDRESS_HOME_STREET_ADDRESS;
180 inputs.push_back(shipping_street); 180 inputs.push_back(shipping_street);
181 181
182 const DetailInputs const_inputs(inputs); 182 FieldValueMap outputs;
183 outputs[inputs[0].type] = ASCIIToUTF16("123 billing street");
184 outputs[inputs[1].type] = ASCIIToUTF16("123 shipping street");
183 185
184 DetailOutputMap outputs; 186 FieldMapWrapper wrapper(outputs);
185 outputs[&const_inputs[0]] = ASCIIToUTF16("123 billing street");
186 outputs[&const_inputs[1]] = ASCIIToUTF16("123 shipping street");
187
188 DetailOutputWrapper wrapper(outputs);
189 wrapper.FillInputs(&inputs); 187 wrapper.FillInputs(&inputs);
190 188
191 EXPECT_NE(inputs[0].initial_value, inputs[1].initial_value); 189 EXPECT_NE(inputs[0].initial_value, inputs[1].initial_value);
192 } 190 }
193 191
194 } // namespace autofill 192 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/data_model_wrapper.cc ('k') | chrome/browser/ui/autofill/mock_autofill_dialog_view_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698