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

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

Issue 301343002: mac: Clean up autofill integration with Address Book. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@autofill_cleanup2_base
Patch Set: Fix a cross-platform problem. Created 6 years, 6 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 "base/guid.h" 7 #include "base/guid.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/prefs/pref_service_factory.h" 9 #include "base/prefs/pref_service_factory.h"
10 #include "base/prefs/testing_pref_store.h" 10 #include "base/prefs/testing_pref_store.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 const char* name_on_card, const char* card_number, 197 const char* name_on_card, const char* card_number,
198 const char* expiration_month, const char* expiration_year) { 198 const char* expiration_month, const char* expiration_year) {
199 check_and_set(credit_card, CREDIT_CARD_NAME, name_on_card); 199 check_and_set(credit_card, CREDIT_CARD_NAME, name_on_card);
200 check_and_set(credit_card, CREDIT_CARD_NUMBER, card_number); 200 check_and_set(credit_card, CREDIT_CARD_NUMBER, card_number);
201 check_and_set(credit_card, CREDIT_CARD_EXP_MONTH, expiration_month); 201 check_and_set(credit_card, CREDIT_CARD_EXP_MONTH, expiration_month);
202 check_and_set(credit_card, CREDIT_CARD_EXP_4_DIGIT_YEAR, expiration_year); 202 check_and_set(credit_card, CREDIT_CARD_EXP_4_DIGIT_YEAR, expiration_year);
203 } 203 }
204 204
205 void DisableSystemServices(PrefService* prefs) { 205 void DisableSystemServices(PrefService* prefs) {
206 // Use a mock Keychain rather than the OS one to store credit card data. 206 // Use a mock Keychain rather than the OS one to store credit card data.
207 #if defined(OS_MACOSX) 207 #if defined(OS_MACOSX)
Ilya Sherman 2014/06/03 23:48:59 I bet you can skip the line below for iOS as well
erikchen 2014/06/04 01:51:26 A cursory inspection did not reveal any reason why
208 OSCrypt::UseMockKeychain(true); 208 OSCrypt::UseMockKeychain(true);
209 #endif 209 #endif
210 210
211 #if defined(OS_MACOSX) && !defined(OS_IOS)
211 // Disable auxiliary profiles for unit testing. These reach out to system 212 // Disable auxiliary profiles for unit testing. These reach out to system
212 // services on the Mac. 213 // services on the Mac.
213 if (prefs) 214 if (prefs)
214 prefs->SetBoolean(prefs::kAutofillAuxiliaryProfilesEnabled, false); 215 prefs->SetBoolean(prefs::kAutofillUseMacAddressBook, false);
216 #endif
Ilya Sherman 2014/06/03 23:48:59 nit: Please add the trailing comment.
erikchen 2014/06/04 01:51:26 Done.
215 } 217 }
216 218
217 } // namespace test 219 } // namespace test
218 } // namespace autofill 220 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698