| 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 #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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 // We implement our own version to avoid some DCHECKs. | 85 // We implement our own version to avoid some DCHECKs. |
| 86 virtual syncer::UserShare* GetUserShare() const OVERRIDE; | 86 virtual syncer::UserShare* GetUserShare() const OVERRIDE; |
| 87 | 87 |
| 88 static TestProfileSyncService* BuildAutoStartAsyncInit( | 88 static TestProfileSyncService* BuildAutoStartAsyncInit( |
| 89 Profile* profile, base::Closure callback); | 89 Profile* profile, base::Closure callback); |
| 90 | 90 |
| 91 ProfileSyncComponentsFactoryMock* components_factory_mock(); | 91 ProfileSyncComponentsFactoryMock* components_factory_mock(); |
| 92 | 92 |
| 93 syncer::TestIdFactory* id_factory(); | 93 syncer::TestIdFactory* id_factory(); |
| 94 | 94 |
| 95 // Raise visibility to ease testing. |
| 96 using ProfileSyncService::NotifyObservers; |
| 97 |
| 95 protected: | 98 protected: |
| 96 static KeyedService* TestFactoryFunction(content::BrowserContext* profile); | 99 static KeyedService* TestFactoryFunction(content::BrowserContext* profile); |
| 97 | 100 |
| 98 // Return NULL handle to use in backend initialization to avoid receiving | 101 // Return NULL handle to use in backend initialization to avoid receiving |
| 99 // js messages on UI loop when it's being destroyed, which are not deleted | 102 // js messages on UI loop when it's being destroyed, which are not deleted |
| 100 // and cause memory leak in test. | 103 // and cause memory leak in test. |
| 101 virtual syncer::WeakHandle<syncer::JsEventHandler> GetJsEventHandler() | 104 virtual syncer::WeakHandle<syncer::JsEventHandler> GetJsEventHandler() |
| 102 OVERRIDE; | 105 OVERRIDE; |
| 103 | 106 |
| 104 private: | 107 private: |
| 105 syncer::TestIdFactory id_factory_; | 108 syncer::TestIdFactory id_factory_; |
| 106 }; | 109 }; |
| 107 | 110 |
| 108 #endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ | 111 #endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ |
| OLD | NEW |