| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 536 | 536 |
| 537 AutoFillProfile expected; | 537 AutoFillProfile expected; |
| 538 autofill_test::SetProfileInfo(&expected, NULL, "George", NULL, | 538 autofill_test::SetProfileInfo(&expected, NULL, "George", NULL, |
| 539 "Washington", "theprez@gmail.com", NULL, NULL, NULL, NULL, NULL, NULL, | 539 "Washington", "theprez@gmail.com", NULL, NULL, NULL, NULL, NULL, NULL, |
| 540 NULL, NULL, NULL); | 540 NULL, NULL, NULL); |
| 541 const std::vector<AutoFillProfile*>& results = personal_data_->profiles(); | 541 const std::vector<AutoFillProfile*>& results = personal_data_->profiles(); |
| 542 ASSERT_EQ(1U, results.size()); | 542 ASSERT_EQ(1U, results.size()); |
| 543 EXPECT_EQ(0, expected.Compare(*results[0])); | 543 EXPECT_EQ(0, expected.Compare(*results[0])); |
| 544 } | 544 } |
| 545 | 545 |
| 546 // Crashy, http://crbug.com/67423. | 546 TEST_F(PersonalDataManagerTest, ImportFormDataNotEnoughFilledFields) { |
| 547 TEST_F(PersonalDataManagerTest, DISABLED_ImportFormDataNotEnoughFilledFields) { | |
| 548 FormData form; | 547 FormData form; |
| 549 webkit_glue::FormField field; | 548 webkit_glue::FormField field; |
| 550 autofill_test::CreateTestFormField( | 549 autofill_test::CreateTestFormField( |
| 551 "First name:", "first_name", "George", "text", &field); | 550 "First name:", "first_name", "George", "text", &field); |
| 552 form.fields.push_back(field); | 551 form.fields.push_back(field); |
| 553 autofill_test::CreateTestFormField( | 552 autofill_test::CreateTestFormField( |
| 554 "Last name:", "last_name", "Washington", "text", &field); | 553 "Last name:", "last_name", "Washington", "text", &field); |
| 555 form.fields.push_back(field); | 554 form.fields.push_back(field); |
| 556 autofill_test::CreateTestFormField( | 555 autofill_test::CreateTestFormField( |
| 557 "Card number:", "card_number", "4111 1111 1111 1111", "text", &field); | 556 "Card number:", "card_number", "4111 1111 1111 1111", "text", &field); |
| 558 form.fields.push_back(field); | 557 form.fields.push_back(field); |
| 559 FormStructure form_structure(form); | 558 FormStructure form_structure(form); |
| 560 std::vector<FormStructure*> forms; | 559 std::vector<FormStructure*> forms; |
| 561 forms.push_back(&form_structure); | 560 forms.push_back(&form_structure); |
| 562 EXPECT_FALSE(personal_data_->ImportFormData(forms)); | 561 EXPECT_FALSE(personal_data_->ImportFormData(forms)); |
| 563 | 562 |
| 564 // Wait for the refresh. | 563 // Wait for the refresh. |
| 565 EXPECT_CALL(personal_data_observer_, | 564 EXPECT_CALL(personal_data_observer_, |
| 566 OnPersonalDataLoaded()).WillOnce(QuitUIMessageLoop()); | 565 OnPersonalDataLoaded()).WillOnce(QuitUIMessageLoop()); |
| 567 | 566 |
| 567 MessageLoop::current()->Run(); |
| 568 |
| 568 const std::vector<AutoFillProfile*>& profiles = personal_data_->profiles(); | 569 const std::vector<AutoFillProfile*>& profiles = personal_data_->profiles(); |
| 569 ASSERT_EQ(0U, profiles.size()); | 570 ASSERT_EQ(0U, profiles.size()); |
| 570 const std::vector<CreditCard*>& credit_cards = personal_data_->credit_cards(); | 571 const std::vector<CreditCard*>& credit_cards = personal_data_->credit_cards(); |
| 571 ASSERT_EQ(0U, credit_cards.size()); | 572 ASSERT_EQ(0U, credit_cards.size()); |
| 572 } | 573 } |
| 573 | 574 |
| 574 TEST_F(PersonalDataManagerTest, ImportPhoneNumberSplitAcrossMultipleFields) { | 575 TEST_F(PersonalDataManagerTest, ImportPhoneNumberSplitAcrossMultipleFields) { |
| 575 FormData form; | 576 FormData form; |
| 576 webkit_glue::FormField field; | 577 webkit_glue::FormField field; |
| 577 autofill_test::CreateTestFormField( | 578 autofill_test::CreateTestFormField( |
| (...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1379 | 1380 |
| 1380 // Expect that the newer information is saved. In this case the year is | 1381 // Expect that the newer information is saved. In this case the year is |
| 1381 // added to the existing credit card. | 1382 // added to the existing credit card. |
| 1382 CreditCard expected2; | 1383 CreditCard expected2; |
| 1383 autofill_test::SetCreditCardInfo(&expected2, | 1384 autofill_test::SetCreditCardInfo(&expected2, |
| 1384 "L1", "Biggie Smalls", "4111111111111111", "01", "2011"); | 1385 "L1", "Biggie Smalls", "4111111111111111", "01", "2011"); |
| 1385 const std::vector<CreditCard*>& results2 = personal_data_->credit_cards(); | 1386 const std::vector<CreditCard*>& results2 = personal_data_->credit_cards(); |
| 1386 ASSERT_EQ(1U, results2.size()); | 1387 ASSERT_EQ(1U, results2.size()); |
| 1387 EXPECT_EQ(0, expected2.Compare(*results2[0])); | 1388 EXPECT_EQ(0, expected2.Compare(*results2[0])); |
| 1388 } | 1389 } |
| OLD | NEW |