| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 AutofillProfile profile2(base::GenerateGUID(), "https://www.example.com"); | 532 AutofillProfile profile2(base::GenerateGUID(), "https://www.example.com"); |
| 533 test::SetProfileInfo(&profile2, | 533 test::SetProfileInfo(&profile2, |
| 534 "Josephine", "Alicia", "Saenz", | 534 "Josephine", "Alicia", "Saenz", |
| 535 "joewayne@me.xyz", "Fox", "1212 Center.", "Bld. 5", "Orlando", "FL", | 535 "joewayne@me.xyz", "Fox", "1212 Center.", "Bld. 5", "Orlando", "FL", |
| 536 "32801", "US", "19482937549"); | 536 "32801", "US", "19482937549"); |
| 537 | 537 |
| 538 // Adjust all labels. | 538 // Adjust all labels. |
| 539 profile_pointers.push_back(&profile2); | 539 profile_pointers.push_back(&profile2); |
| 540 AutofillProfile::AdjustInferredLabels(&profile_pointers); | 540 AutofillProfile::AdjustInferredLabels(&profile_pointers); |
| 541 | 541 |
| 542 scoped_refptr<AutofillWebDataService> wds = | 542 AutofillWebDataService* wds = |
| 543 AutofillWebDataService::FromBrowserContext(profile_.get()); | 543 AutofillWebDataService::FromBrowserContext(profile_.get()); |
| 544 ASSERT_TRUE(wds.get()); | 544 ASSERT_TRUE(wds); |
| 545 wds->AddAutofillProfile(profile2); | 545 wds->AddAutofillProfile(profile2); |
| 546 | 546 |
| 547 personal_data_->Refresh(); | 547 personal_data_->Refresh(); |
| 548 | 548 |
| 549 // Verify that the web database has been updated and the notification sent. | 549 // Verify that the web database has been updated and the notification sent. |
| 550 EXPECT_CALL(personal_data_observer_, | 550 EXPECT_CALL(personal_data_observer_, |
| 551 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop()); | 551 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop()); |
| 552 base::MessageLoop::current()->Run(); | 552 base::MessageLoop::current()->Run(); |
| 553 | 553 |
| 554 const std::vector<AutofillProfile*>& results2 = personal_data_->GetProfiles(); | 554 const std::vector<AutofillProfile*>& results2 = personal_data_->GetProfiles(); |
| (...skipping 1743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2298 // Removing shouldn't work. | 2298 // Removing shouldn't work. |
| 2299 personal_data_->RemoveByGUID(steve_jobs.guid()); | 2299 personal_data_->RemoveByGUID(steve_jobs.guid()); |
| 2300 personal_data_->RemoveByGUID(bill_gates.guid()); | 2300 personal_data_->RemoveByGUID(bill_gates.guid()); |
| 2301 | 2301 |
| 2302 ResetPersonalDataManager(); | 2302 ResetPersonalDataManager(); |
| 2303 EXPECT_EQ(1U, personal_data_->GetProfiles().size()); | 2303 EXPECT_EQ(1U, personal_data_->GetProfiles().size()); |
| 2304 EXPECT_EQ(1U, personal_data_->GetCreditCards().size()); | 2304 EXPECT_EQ(1U, personal_data_->GetCreditCards().size()); |
| 2305 } | 2305 } |
| 2306 | 2306 |
| 2307 } // namespace autofill | 2307 } // namespace autofill |
| OLD | NEW |