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

Side by Side Diff: components/autofill/core/browser/autofill_test_utils.cc

Issue 1694443004: [Autofill] Add credit card first and last name heuristics predictions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 9 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 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 "components/autofill/core/browser/autofill_test_utils.h" 5 #include "components/autofill/core/browser/autofill_test_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/guid.h" 9 #include "base/guid.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 if (guid) 273 if (guid)
274 profile->set_guid(guid); 274 profile->set_guid(guid);
275 SetProfileInfo(profile, first_name, middle_name, last_name, email, 275 SetProfileInfo(profile, first_name, middle_name, last_name, email,
276 company, address1, address2, city, state, zipcode, country, 276 company, address1, address2, city, state, zipcode, country,
277 phone); 277 phone);
278 } 278 }
279 279
280 void SetCreditCardInfo(CreditCard* credit_card, 280 void SetCreditCardInfo(CreditCard* credit_card,
281 const char* name_on_card, const char* card_number, 281 const char* name_on_card, const char* card_number,
282 const char* expiration_month, const char* expiration_year) { 282 const char* expiration_month, const char* expiration_year) {
283 check_and_set(credit_card, CREDIT_CARD_NAME, name_on_card); 283 check_and_set(credit_card, CREDIT_CARD_NAME_FULL, name_on_card);
284 check_and_set(credit_card, CREDIT_CARD_NUMBER, card_number); 284 check_and_set(credit_card, CREDIT_CARD_NUMBER, card_number);
285 check_and_set(credit_card, CREDIT_CARD_EXP_MONTH, expiration_month); 285 check_and_set(credit_card, CREDIT_CARD_EXP_MONTH, expiration_month);
286 check_and_set(credit_card, CREDIT_CARD_EXP_4_DIGIT_YEAR, expiration_year); 286 check_and_set(credit_card, CREDIT_CARD_EXP_4_DIGIT_YEAR, expiration_year);
287 } 287 }
288 288
289 void DisableSystemServices(PrefService* prefs) { 289 void DisableSystemServices(PrefService* prefs) {
290 // Use a mock Keychain rather than the OS one to store credit card data. 290 // Use a mock Keychain rather than the OS one to store credit card data.
291 #if defined(OS_MACOSX) 291 #if defined(OS_MACOSX)
292 OSCrypt::UseMockKeychain(true); 292 OSCrypt::UseMockKeychain(true);
293 #endif // defined(OS_MACOSX) 293 #endif // defined(OS_MACOSX)
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 if (name) 340 if (name)
341 field->set_name(name); 341 field->set_name(name);
342 if (control_type) 342 if (control_type)
343 field->set_type(control_type); 343 field->set_type(control_type);
344 if (label) 344 if (label)
345 field->set_label(label); 345 field->set_label(label);
346 } 346 }
347 347
348 } // namespace test 348 } // namespace test
349 } // namespace autofill 349 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/autofill_regex_constants.cc ('k') | components/autofill/core/browser/autofill_type.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698