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/live_autofill_sync_test.h" | 5 #include "chrome/test/live_sync/live_autofill_sync_test.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/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/sync/profile_sync_service.h" | 11 #include "chrome/browser/sync/profile_sync_service.h" |
12 #include "chrome/browser/sync/profile_sync_test_util.h" | 12 #include "chrome/browser/sync/profile_sync_test_util.h" |
13 #include "chrome/browser/webdata/autofill_entry.h" | 13 #include "chrome/browser/webdata/autofill_entry.h" |
14 #include "chrome/browser/webdata/web_database.h" | 14 #include "chrome/browser/webdata/web_database.h" |
| 15 #include "chrome/common/chrome_notification_types.h" |
15 #include "chrome/test/thread_observer_helper.h" | 16 #include "chrome/test/thread_observer_helper.h" |
16 #include "webkit/glue/form_field.h" | 17 #include "webkit/glue/form_field.h" |
17 | 18 |
18 | 19 |
19 using base::WaitableEvent; | 20 using base::WaitableEvent; |
20 using testing::_; | 21 using testing::_; |
21 | 22 |
22 namespace { | 23 namespace { |
23 class GetAllAutofillEntries | 24 class GetAllAutofillEntries |
24 : public base::RefCountedThreadSafe<GetAllAutofillEntries> { | 25 : public base::RefCountedThreadSafe<GetAllAutofillEntries> { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 }; | 57 }; |
57 | 58 |
58 ACTION_P(SignalEvent, event) { | 59 ACTION_P(SignalEvent, event) { |
59 event->Signal(); | 60 event->Signal(); |
60 } | 61 } |
61 | 62 |
62 class AutofillDBThreadObserverHelper : public DBThreadObserverHelper { | 63 class AutofillDBThreadObserverHelper : public DBThreadObserverHelper { |
63 protected: | 64 protected: |
64 virtual void RegisterObservers() { | 65 virtual void RegisterObservers() { |
65 registrar_.Add(&observer_, | 66 registrar_.Add(&observer_, |
66 NotificationType::AUTOFILL_ENTRIES_CHANGED, | 67 chrome::NOTIFICATION_AUTOFILL_ENTRIES_CHANGED, |
67 NotificationService::AllSources()); | 68 NotificationService::AllSources()); |
68 registrar_.Add(&observer_, | 69 registrar_.Add(&observer_, |
69 NotificationType::AUTOFILL_PROFILE_CHANGED, | 70 chrome::NOTIFICATION_AUTOFILL_PROFILE_CHANGED, |
70 NotificationService::AllSources()); | 71 NotificationService::AllSources()); |
71 } | 72 } |
72 }; | 73 }; |
73 | 74 |
74 class MockPersonalDataManagerObserver : public PersonalDataManager::Observer { | 75 class MockPersonalDataManagerObserver : public PersonalDataManager::Observer { |
75 public: | 76 public: |
76 MOCK_METHOD0(OnPersonalDataChanged, void()); | 77 MOCK_METHOD0(OnPersonalDataChanged, void()); |
77 }; | 78 }; |
78 | 79 |
79 } // namespace | 80 } // namespace |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 bool LiveAutofillSyncTest::AllProfilesMatch() { | 285 bool LiveAutofillSyncTest::AllProfilesMatch() { |
285 for (int i = 1; i < num_clients(); ++i) { | 286 for (int i = 1; i < num_clients(); ++i) { |
286 if (!ProfilesMatch(0, i)) { | 287 if (!ProfilesMatch(0, i)) { |
287 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " | 288 LOG(ERROR) << "Profile " << i << "does not contain the same autofill " |
288 "profiles as profile 0."; | 289 "profiles as profile 0."; |
289 return false; | 290 return false; |
290 } | 291 } |
291 } | 292 } |
292 return true; | 293 return true; |
293 } | 294 } |
OLD | NEW |