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

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

Issue 16254010: [Autofill] Update credit card type detection logic. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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 | 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 <string> 5 #include <string>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/guid.h" 8 #include "base/guid.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 2212 matching lines...) Expand 10 before | Expand all | Expand 10 after
2223 "John Dillinger", "423456789012" /* Visa */, 2223 "John Dillinger", "423456789012" /* Visa */,
2224 "01", "2010"); 2224 "01", "2010");
2225 personal_data_->AddCreditCard(credit_card); 2225 personal_data_->AddCreditCard(credit_card);
2226 2226
2227 // Verify that the web database has been updated and the notification sent. 2227 // Verify that the web database has been updated and the notification sent.
2228 EXPECT_CALL(personal_data_observer_, 2228 EXPECT_CALL(personal_data_observer_,
2229 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop()); 2229 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop());
2230 base::MessageLoop::current()->Run(); 2230 base::MessageLoop::current()->Run();
2231 2231
2232 personal_data_->GetNonEmptyTypes(&non_empty_types); 2232 personal_data_->GetNonEmptyTypes(&non_empty_types);
2233 EXPECT_EQ(25U, non_empty_types.size()); 2233 EXPECT_EQ(26U, non_empty_types.size());
2234 EXPECT_TRUE(non_empty_types.count(NAME_FIRST)); 2234 EXPECT_TRUE(non_empty_types.count(NAME_FIRST));
2235 EXPECT_TRUE(non_empty_types.count(NAME_MIDDLE)); 2235 EXPECT_TRUE(non_empty_types.count(NAME_MIDDLE));
2236 EXPECT_TRUE(non_empty_types.count(NAME_MIDDLE_INITIAL)); 2236 EXPECT_TRUE(non_empty_types.count(NAME_MIDDLE_INITIAL));
2237 EXPECT_TRUE(non_empty_types.count(NAME_LAST)); 2237 EXPECT_TRUE(non_empty_types.count(NAME_LAST));
2238 EXPECT_TRUE(non_empty_types.count(NAME_FULL)); 2238 EXPECT_TRUE(non_empty_types.count(NAME_FULL));
2239 EXPECT_TRUE(non_empty_types.count(EMAIL_ADDRESS)); 2239 EXPECT_TRUE(non_empty_types.count(EMAIL_ADDRESS));
2240 EXPECT_TRUE(non_empty_types.count(COMPANY_NAME)); 2240 EXPECT_TRUE(non_empty_types.count(COMPANY_NAME));
2241 EXPECT_TRUE(non_empty_types.count(ADDRESS_HOME_LINE1)); 2241 EXPECT_TRUE(non_empty_types.count(ADDRESS_HOME_LINE1));
2242 EXPECT_TRUE(non_empty_types.count(ADDRESS_HOME_LINE2)); 2242 EXPECT_TRUE(non_empty_types.count(ADDRESS_HOME_LINE2));
2243 EXPECT_TRUE(non_empty_types.count(ADDRESS_HOME_CITY)); 2243 EXPECT_TRUE(non_empty_types.count(ADDRESS_HOME_CITY));
2244 EXPECT_TRUE(non_empty_types.count(ADDRESS_HOME_STATE)); 2244 EXPECT_TRUE(non_empty_types.count(ADDRESS_HOME_STATE));
2245 EXPECT_TRUE(non_empty_types.count(ADDRESS_HOME_ZIP)); 2245 EXPECT_TRUE(non_empty_types.count(ADDRESS_HOME_ZIP));
2246 EXPECT_TRUE(non_empty_types.count(ADDRESS_HOME_COUNTRY)); 2246 EXPECT_TRUE(non_empty_types.count(ADDRESS_HOME_COUNTRY));
2247 EXPECT_TRUE(non_empty_types.count(PHONE_HOME_NUMBER)); 2247 EXPECT_TRUE(non_empty_types.count(PHONE_HOME_NUMBER));
2248 EXPECT_TRUE(non_empty_types.count(PHONE_HOME_CITY_CODE)); 2248 EXPECT_TRUE(non_empty_types.count(PHONE_HOME_CITY_CODE));
2249 EXPECT_TRUE(non_empty_types.count(PHONE_HOME_COUNTRY_CODE)); 2249 EXPECT_TRUE(non_empty_types.count(PHONE_HOME_COUNTRY_CODE));
2250 EXPECT_TRUE(non_empty_types.count(PHONE_HOME_CITY_AND_NUMBER)); 2250 EXPECT_TRUE(non_empty_types.count(PHONE_HOME_CITY_AND_NUMBER));
2251 EXPECT_TRUE(non_empty_types.count(PHONE_HOME_WHOLE_NUMBER)); 2251 EXPECT_TRUE(non_empty_types.count(PHONE_HOME_WHOLE_NUMBER));
2252 EXPECT_TRUE(non_empty_types.count(CREDIT_CARD_NAME)); 2252 EXPECT_TRUE(non_empty_types.count(CREDIT_CARD_NAME));
2253 EXPECT_TRUE(non_empty_types.count(CREDIT_CARD_NUMBER)); 2253 EXPECT_TRUE(non_empty_types.count(CREDIT_CARD_NUMBER));
2254 EXPECT_TRUE(non_empty_types.count(CREDIT_CARD_TYPE));
2254 EXPECT_TRUE(non_empty_types.count(CREDIT_CARD_EXP_MONTH)); 2255 EXPECT_TRUE(non_empty_types.count(CREDIT_CARD_EXP_MONTH));
2255 EXPECT_TRUE(non_empty_types.count(CREDIT_CARD_EXP_2_DIGIT_YEAR)); 2256 EXPECT_TRUE(non_empty_types.count(CREDIT_CARD_EXP_2_DIGIT_YEAR));
2256 EXPECT_TRUE(non_empty_types.count(CREDIT_CARD_EXP_4_DIGIT_YEAR)); 2257 EXPECT_TRUE(non_empty_types.count(CREDIT_CARD_EXP_4_DIGIT_YEAR));
2257 EXPECT_TRUE(non_empty_types.count(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR)); 2258 EXPECT_TRUE(non_empty_types.count(CREDIT_CARD_EXP_DATE_2_DIGIT_YEAR));
2258 EXPECT_TRUE(non_empty_types.count(CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR)); 2259 EXPECT_TRUE(non_empty_types.count(CREDIT_CARD_EXP_DATE_4_DIGIT_YEAR));
2259 } 2260 }
2260 2261
2261 TEST_F(PersonalDataManagerTest, CaseInsensitiveMultiValueAggregation) { 2262 TEST_F(PersonalDataManagerTest, CaseInsensitiveMultiValueAggregation) {
2262 FormData form1; 2263 FormData form1;
2263 FormFieldData field; 2264 FormFieldData field;
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
2416 // Removing shouldn't work. 2417 // Removing shouldn't work.
2417 personal_data_->RemoveByGUID(steve_jobs.guid()); 2418 personal_data_->RemoveByGUID(steve_jobs.guid());
2418 personal_data_->RemoveByGUID(bill_gates.guid()); 2419 personal_data_->RemoveByGUID(bill_gates.guid());
2419 2420
2420 ResetPersonalDataManager(); 2421 ResetPersonalDataManager();
2421 EXPECT_EQ(1U, personal_data_->GetProfiles().size()); 2422 EXPECT_EQ(1U, personal_data_->GetProfiles().size());
2422 EXPECT_EQ(1U, personal_data_->GetCreditCards().size()); 2423 EXPECT_EQ(1U, personal_data_->GetCreditCards().size());
2423 } 2424 }
2424 2425
2425 } // namespace autofill 2426 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/browser/credit_card_unittest.cc ('k') | components/autofill/core/browser/validation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698