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

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

Issue 1692873004: Move ProfileSyncService tests for autofill & typed URLs to components (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@581640_no_browser_thread
Patch Set: Created 4 years, 10 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_
6 #define CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_
7
8 #include "base/macros.h"
9 #include "components/browser_sync/browser/profile_sync_service.h"
10 #include "components/sync_driver/data_type_manager.h"
11 #include "sync/internal_api/public/util/weak_handle.h"
12 #include "sync/js/js_event_handler.h"
13 #include "sync/test/engine/test_id_factory.h"
14
15 namespace sync_driver {
16 class SyncPrefs;
17 } // namespace sync_driver
18
19 class TestProfileSyncService : public ProfileSyncService {
20 public:
21 explicit TestProfileSyncService(InitParams init_params);
22
23 ~TestProfileSyncService() override;
24
25 void OnConfigureDone(
26 const sync_driver::DataTypeManager::ConfigureResult& result) override;
27
28 // We implement our own version to avoid some DCHECKs.
29 syncer::UserShare* GetUserShare() const override;
30
31 syncer::TestIdFactory* id_factory();
32
33 // Raise visibility to ease testing.
34 using ProfileSyncService::NotifyObservers;
35
36 sync_driver::SyncPrefs* sync_prefs() { return &sync_prefs_; }
37
38 protected:
39 // Return NULL handle to use in backend initialization to avoid receiving
40 // js messages on UI loop when it's being destroyed, which are not deleted
41 // and cause memory leak in test.
42 syncer::WeakHandle<syncer::JsEventHandler> GetJsEventHandler() override;
43
44 bool NeedBackup() const override;
45
46 private:
47 syncer::TestIdFactory id_factory_;
48
49 DISALLOW_COPY_AND_ASSIGN(TestProfileSyncService);
50 };
51
52 #endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698