Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: chrome/browser/sync/test_profile_sync_service.h

Issue 10805002: [Sync] Enable adding notifier observers from ProfileSyncService (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ 5 #ifndef CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_
6 #define CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ 6 #define CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 15 matching lines...) Expand all
26 ACTION(ReturnNewDataTypeManager) { 26 ACTION(ReturnNewDataTypeManager) {
27 return new browser_sync::DataTypeManagerImpl(arg0, arg1); 27 return new browser_sync::DataTypeManagerImpl(arg0, arg1);
28 } 28 }
29 29
30 namespace browser_sync { 30 namespace browser_sync {
31 31
32 class SyncBackendHostForProfileSyncTest : public SyncBackendHost { 32 class SyncBackendHostForProfileSyncTest : public SyncBackendHost {
33 public: 33 public:
34 // |synchronous_init| causes initialization to block until the syncapi has 34 // |synchronous_init| causes initialization to block until the syncapi has
35 // completed setting itself up and called us back. 35 // completed setting itself up and called us back.
36 // TOOD(akalin): Remove |synchronous_init| (http://crbug.com/140354).
36 SyncBackendHostForProfileSyncTest( 37 SyncBackendHostForProfileSyncTest(
37 Profile* profile, 38 Profile* profile,
38 const base::WeakPtr<SyncPrefs>& sync_prefs, 39 const base::WeakPtr<SyncPrefs>& sync_prefs,
39 const base::WeakPtr<InvalidatorStorage>& invalidator_storage, 40 const base::WeakPtr<InvalidatorStorage>& invalidator_storage,
40 syncer::TestIdFactory& id_factory, 41 syncer::TestIdFactory& id_factory,
41 base::Closure& callback, 42 base::Closure& callback,
42 bool set_initial_sync_ended_on_init, 43 bool set_initial_sync_ended_on_init,
43 bool synchronous_init, 44 bool synchronous_init,
44 bool fail_initial_download, 45 bool fail_initial_download,
45 syncer::StorageOption storage_option); 46 syncer::StorageOption storage_option);
46 virtual ~SyncBackendHostForProfileSyncTest(); 47 virtual ~SyncBackendHostForProfileSyncTest();
47 48
48 MOCK_METHOD1(RequestNudge, void(const tracked_objects::Location&)); 49 MOCK_METHOD1(RequestNudge, void(const tracked_objects::Location&));
49 50
50 virtual void RequestConfigureSyncer( 51 virtual void RequestConfigureSyncer(
51 syncer::ConfigureReason reason, 52 syncer::ConfigureReason reason,
52 syncer::ModelTypeSet types_to_config, 53 syncer::ModelTypeSet types_to_config,
53 const syncer::ModelSafeRoutingInfo& routing_info, 54 const syncer::ModelSafeRoutingInfo& routing_info,
54 const base::Callback<void(syncer::ModelTypeSet)>& ready_task, 55 const base::Callback<void(syncer::ModelTypeSet)>& ready_task,
55 const base::Closure& retry_callback) OVERRIDE; 56 const base::Closure& retry_callback) OVERRIDE;
56 57
57 virtual void HandleSyncManagerInitializationOnFrontendLoop( 58 virtual void HandleSyncManagerInitializationOnFrontendLoop(
58 const syncer::WeakHandle<syncer::JsBackend>& js_backend, bool success, 59 const syncer::WeakHandle<syncer::JsBackend>& js_backend, bool success,
59 syncer::ModelTypeSet restored_types) OVERRIDE; 60 syncer::ModelTypeSet restored_types) OVERRIDE;
60 61
61 static void SetHistoryServiceExpectations(ProfileMock* profile); 62 static void SetHistoryServiceExpectations(ProfileMock* profile);
62 63
63 void SetInitialSyncEndedForAllTypes(); 64 void SetInitialSyncEndedForAllTypes();
64 void dont_set_initial_sync_ended_on_init(); 65
66 void EmitOnNotificationsEnabled();
67 void EmitOnNotificationsDisabled(
68 syncer::NotificationsDisabledReason reason);
69 void EmitOnIncomingNotification(
70 const syncer::ObjectIdPayloadMap& id_payloads,
71 const syncer::IncomingNotificationSource source);
65 72
66 protected: 73 protected:
67 virtual void InitCore(const DoInitializeOptions& options) OVERRIDE; 74 virtual void InitCore(const DoInitializeOptions& options) OVERRIDE;
68 75
69 private: 76 private:
70 syncer::TestIdFactory& id_factory_; 77 syncer::TestIdFactory& id_factory_;
71 base::Closure& callback_; 78 base::Closure& callback_;
72 79
73 bool set_initial_sync_ended_on_init_; 80 bool set_initial_sync_ended_on_init_;
74 bool synchronous_init_; 81 bool synchronous_init_;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 bool synchronous_sync_configuration_; 141 bool synchronous_sync_configuration_;
135 142
136 base::Closure callback_; 143 base::Closure callback_;
137 bool set_initial_sync_ended_on_init_; 144 bool set_initial_sync_ended_on_init_;
138 145
139 bool fail_initial_download_; 146 bool fail_initial_download_;
140 syncer::StorageOption storage_option_; 147 syncer::StorageOption storage_option_;
141 }; 148 };
142 149
143 #endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ 150 #endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698