| 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/browser/sync/glue/sync_backend_host.h" | 5 #include "chrome/browser/sync/glue/sync_backend_host.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 MOCK_METHOD2(OnBackendInitialized, void(const WeakHandle<JsBackend>&, bool)); | 34 MOCK_METHOD2(OnBackendInitialized, void(const WeakHandle<JsBackend>&, bool)); |
| 35 MOCK_METHOD0(OnSyncCycleCompleted, void()); | 35 MOCK_METHOD0(OnSyncCycleCompleted, void()); |
| 36 MOCK_METHOD0(OnAuthError, void()); | 36 MOCK_METHOD0(OnAuthError, void()); |
| 37 MOCK_METHOD0(OnStopSyncingPermanently, void()); | 37 MOCK_METHOD0(OnStopSyncingPermanently, void()); |
| 38 MOCK_METHOD0(OnClearServerDataSucceeded, void()); | 38 MOCK_METHOD0(OnClearServerDataSucceeded, void()); |
| 39 MOCK_METHOD0(OnClearServerDataFailed, void()); | 39 MOCK_METHOD0(OnClearServerDataFailed, void()); |
| 40 MOCK_METHOD1(OnPassphraseRequired, void(sync_api::PassphraseRequiredReason)); | 40 MOCK_METHOD1(OnPassphraseRequired, void(sync_api::PassphraseRequiredReason)); |
| 41 MOCK_METHOD0(OnPassphraseAccepted, void()); | 41 MOCK_METHOD0(OnPassphraseAccepted, void()); |
| 42 MOCK_METHOD2(OnEncryptedTypesChanged, | 42 MOCK_METHOD2(OnEncryptedTypesChanged, |
| 43 void(const syncable::ModelTypeSet&, bool)); | 43 void(syncable::ModelEnumSet, bool)); |
| 44 MOCK_METHOD0(OnEncryptionComplete, void()); | 44 MOCK_METHOD0(OnEncryptionComplete, void()); |
| 45 MOCK_METHOD1(OnMigrationNeededForTypes, void(const syncable::ModelTypeSet&)); | 45 MOCK_METHOD1(OnMigrationNeededForTypes, void(syncable::ModelEnumSet)); |
| 46 MOCK_METHOD1(OnDataTypesChanged, void(const syncable::ModelTypeSet&)); | 46 MOCK_METHOD1(OnDataTypesChanged, void(syncable::ModelEnumSet)); |
| 47 MOCK_METHOD1(OnActionableError, | 47 MOCK_METHOD1(OnActionableError, |
| 48 void(const browser_sync::SyncProtocolError& sync_error)); | 48 void(const browser_sync::SyncProtocolError& sync_error)); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace | 51 } // namespace |
| 52 | 52 |
| 53 class SyncBackendHostTest : public testing::Test { | 53 class SyncBackendHostTest : public testing::Test { |
| 54 protected: | 54 protected: |
| 55 SyncBackendHostTest() | 55 SyncBackendHostTest() |
| 56 : ui_thread_(BrowserThread::UI, &ui_loop_), | 56 : ui_thread_(BrowserThread::UI, &ui_loop_), |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 SyncBackendHost backend(profile.GetDebugName(), | 90 SyncBackendHost backend(profile.GetDebugName(), |
| 91 &profile, sync_prefs.AsWeakPtr()); | 91 &profile, sync_prefs.AsWeakPtr()); |
| 92 | 92 |
| 93 MockSyncFrontend mock_frontend; | 93 MockSyncFrontend mock_frontend; |
| 94 sync_api::SyncCredentials credentials; | 94 sync_api::SyncCredentials credentials; |
| 95 credentials.email = "user@example.com"; | 95 credentials.email = "user@example.com"; |
| 96 credentials.sync_token = "sync_token"; | 96 credentials.sync_token = "sync_token"; |
| 97 backend.Initialize(&mock_frontend, | 97 backend.Initialize(&mock_frontend, |
| 98 WeakHandle<JsEventHandler>(), | 98 WeakHandle<JsEventHandler>(), |
| 99 GURL(k_mock_url), | 99 GURL(k_mock_url), |
| 100 syncable::ModelTypeSet(), | 100 syncable::ModelEnumSet(), |
| 101 credentials, | 101 credentials, |
| 102 true); | 102 true); |
| 103 backend.StopSyncingForShutdown(); | 103 backend.StopSyncingForShutdown(); |
| 104 backend.Shutdown(false); | 104 backend.Shutdown(false); |
| 105 } | 105 } |
| 106 | 106 |
| 107 // TODO(akalin): Write more SyncBackendHost unit tests. | 107 // TODO(akalin): Write more SyncBackendHost unit tests. |
| 108 | 108 |
| 109 } // namespace browser_sync | 109 } // namespace browser_sync |
| OLD | NEW |