OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/test/live_sync/autofill_helper.h" | 5 #include "chrome/test/live_sync/autofill_helper.h" |
6 | 6 |
7 #include "chrome/browser/autofill/autofill_common_test.h" | 7 #include "chrome/browser/autofill/autofill_common_test.h" |
8 #include "chrome/browser/autofill/autofill_profile.h" | 8 #include "chrome/browser/autofill/autofill_profile.h" |
9 #include "chrome/browser/autofill/autofill_type.h" | 9 #include "chrome/browser/autofill/autofill_type.h" |
| 10 #include "chrome/browser/autofill/personal_data_manager.h" |
| 11 #include "chrome/browser/autofill/personal_data_manager_observer.h" |
10 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/sync/profile_sync_service.h" | 13 #include "chrome/browser/sync/profile_sync_service.h" |
12 #include "chrome/browser/sync/profile_sync_test_util.h" | 14 #include "chrome/browser/sync/profile_sync_test_util.h" |
13 #include "chrome/browser/webdata/autofill_entry.h" | 15 #include "chrome/browser/webdata/autofill_entry.h" |
14 #include "chrome/browser/webdata/autofill_table.h" | 16 #include "chrome/browser/webdata/autofill_table.h" |
15 #include "chrome/browser/webdata/web_database.h" | 17 #include "chrome/browser/webdata/web_database.h" |
16 #include "chrome/common/chrome_notification_types.h" | 18 #include "chrome/common/chrome_notification_types.h" |
17 #include "chrome/test/live_sync/live_sync_test.h" | 19 #include "chrome/test/live_sync/live_sync_test.h" |
18 #include "chrome/test/base/thread_observer_helper.h" | 20 #include "chrome/test/base/thread_observer_helper.h" |
19 #include "webkit/glue/form_field.h" | 21 #include "webkit/glue/form_field.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 virtual void RegisterObservers() { | 68 virtual void RegisterObservers() { |
67 registrar_.Add(&observer_, | 69 registrar_.Add(&observer_, |
68 chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED, | 70 chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED, |
69 NotificationService::AllSources()); | 71 NotificationService::AllSources()); |
70 registrar_.Add(&observer_, | 72 registrar_.Add(&observer_, |
71 chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED, | 73 chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED, |
72 NotificationService::AllSources()); | 74 NotificationService::AllSources()); |
73 } | 75 } |
74 }; | 76 }; |
75 | 77 |
76 class MockPersonalDataManagerObserver : public PersonalDataManager::Observer { | 78 class MockPersonalDataManagerObserver : public PersonalDataManagerObserver { |
77 public: | 79 public: |
78 MOCK_METHOD0(OnPersonalDataChanged, void()); | 80 MOCK_METHOD0(OnPersonalDataChanged, void()); |
79 }; | 81 }; |
80 | 82 |
81 } // namespace | 83 } // namespace |
82 | 84 |
83 AutofillHelper::AutofillHelper() {} | 85 AutofillHelper::AutofillHelper() {} |
84 | 86 |
85 AutofillHelper::~AutofillHelper() {} | 87 AutofillHelper::~AutofillHelper() {} |
86 | 88 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 bool AutofillHelper::AllProfilesMatch() { | 302 bool AutofillHelper::AllProfilesMatch() { |
301 for (int i = 1; i < test()->num_clients(); ++i) { | 303 for (int i = 1; i < test()->num_clients(); ++i) { |
302 if (!ProfilesMatch(0, i)) { | 304 if (!ProfilesMatch(0, i)) { |
303 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " | 305 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " |
304 "profiles as profile 0."; | 306 "profiles as profile 0."; |
305 return false; | 307 return false; |
306 } | 308 } |
307 } | 309 } |
308 return true; | 310 return true; |
309 } | 311 } |
OLD | NEW |