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" |
11 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/browser/api/webdata/autofill_web_data_service.h" |
13 #include "chrome/browser/password_manager/encryptor.h" | 14 #include "chrome/browser/password_manager/encryptor.h" |
14 #include "chrome/browser/webdata/web_data_service.h" | |
15 #include "chrome/test/base/testing_browser_process.h" | 15 #include "chrome/test/base/testing_browser_process.h" |
16 #include "chrome/test/base/testing_profile.h" | 16 #include "chrome/test/base/testing_profile.h" |
17 #include "components/autofill/browser/autofill_common_test.h" | 17 #include "components/autofill/browser/autofill_common_test.h" |
18 #include "components/autofill/browser/autofill_metrics.h" | 18 #include "components/autofill/browser/autofill_metrics.h" |
19 #include "components/autofill/browser/autofill_profile.h" | 19 #include "components/autofill/browser/autofill_profile.h" |
20 #include "components/autofill/browser/form_structure.h" | 20 #include "components/autofill/browser/form_structure.h" |
21 #include "components/autofill/browser/personal_data_manager.h" | 21 #include "components/autofill/browser/personal_data_manager.h" |
22 #include "components/autofill/browser/personal_data_manager_observer.h" | 22 #include "components/autofill/browser/personal_data_manager_observer.h" |
23 #include "components/autofill/common/form_data.h" | 23 #include "components/autofill/common/form_data.h" |
24 #include "content/public/browser/notification_details.h" | 24 #include "content/public/browser/notification_details.h" |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 AutofillProfile profile2; | 452 AutofillProfile profile2; |
453 autofill_test::SetProfileInfo(&profile2, | 453 autofill_test::SetProfileInfo(&profile2, |
454 "Josephine", "Alicia", "Saenz", | 454 "Josephine", "Alicia", "Saenz", |
455 "joewayne@me.xyz", "Fox", "1212 Center.", "Bld. 5", "Orlando", "FL", | 455 "joewayne@me.xyz", "Fox", "1212 Center.", "Bld. 5", "Orlando", "FL", |
456 "32801", "US", "19482937549"); | 456 "32801", "US", "19482937549"); |
457 | 457 |
458 // Adjust all labels. | 458 // Adjust all labels. |
459 profile_pointers.push_back(&profile2); | 459 profile_pointers.push_back(&profile2); |
460 AutofillProfile::AdjustInferredLabels(&profile_pointers); | 460 AutofillProfile::AdjustInferredLabels(&profile_pointers); |
461 | 461 |
462 scoped_refptr<WebDataService> wds = | 462 scoped_refptr<AutofillWebDataService> wds = |
463 WebDataService::FromBrowserContext(profile_.get()); | 463 AutofillWebDataService::FromBrowserContext(profile_.get()); |
464 ASSERT_TRUE(wds.get()); | 464 ASSERT_TRUE(wds.get()); |
465 wds->AddAutofillProfile(profile2); | 465 wds->AddAutofillProfile(profile2); |
466 | 466 |
467 personal_data_->Refresh(); | 467 personal_data_->Refresh(); |
468 | 468 |
469 // Verify that the web database has been updated and the notification sent. | 469 // Verify that the web database has been updated and the notification sent. |
470 EXPECT_CALL(personal_data_observer_, | 470 EXPECT_CALL(personal_data_observer_, |
471 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop()); | 471 OnPersonalDataChanged()).WillOnce(QuitUIMessageLoop()); |
472 MessageLoop::current()->Run(); | 472 MessageLoop::current()->Run(); |
473 | 473 |
(...skipping 1497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1971 | 1971 |
1972 // Modify expected to include multi-valued fields. | 1972 // Modify expected to include multi-valued fields. |
1973 std::vector<string16> values; | 1973 std::vector<string16> values; |
1974 expected.GetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, &values); | 1974 expected.GetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, &values); |
1975 values.push_back(ASCIIToUTF16("(214) 555-1234")); | 1975 values.push_back(ASCIIToUTF16("(214) 555-1234")); |
1976 expected.SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, values); | 1976 expected.SetRawMultiInfo(PHONE_HOME_WHOLE_NUMBER, values); |
1977 | 1977 |
1978 ASSERT_EQ(1U, results2.size()); | 1978 ASSERT_EQ(1U, results2.size()); |
1979 EXPECT_EQ(0, expected.Compare(*results2[0])); | 1979 EXPECT_EQ(0, expected.Compare(*results2[0])); |
1980 } | 1980 } |
OLD | NEW |