| 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 #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 28 matching lines...) Expand all Loading... |
| 39 MOCK_METHOD1(OnConnectionStatusChange, | 39 MOCK_METHOD1(OnConnectionStatusChange, |
| 40 void(syncer::ConnectionStatus status)); | 40 void(syncer::ConnectionStatus status)); |
| 41 MOCK_METHOD0(OnStopSyncingPermanently, void()); | 41 MOCK_METHOD0(OnStopSyncingPermanently, void()); |
| 42 MOCK_METHOD0(OnClearServerDataSucceeded, void()); | 42 MOCK_METHOD0(OnClearServerDataSucceeded, void()); |
| 43 MOCK_METHOD0(OnClearServerDataFailed, void()); | 43 MOCK_METHOD0(OnClearServerDataFailed, void()); |
| 44 MOCK_METHOD2(OnPassphraseRequired, | 44 MOCK_METHOD2(OnPassphraseRequired, |
| 45 void(syncer::PassphraseRequiredReason, | 45 void(syncer::PassphraseRequiredReason, |
| 46 const sync_pb::EncryptedData&)); | 46 const sync_pb::EncryptedData&)); |
| 47 MOCK_METHOD0(OnPassphraseAccepted, void()); | 47 MOCK_METHOD0(OnPassphraseAccepted, void()); |
| 48 MOCK_METHOD2(OnEncryptedTypesChanged, | 48 MOCK_METHOD2(OnEncryptedTypesChanged, |
| 49 void(syncable::ModelTypeSet, bool)); | 49 void(syncer::ModelTypeSet, bool)); |
| 50 MOCK_METHOD0(OnEncryptionComplete, void()); | 50 MOCK_METHOD0(OnEncryptionComplete, void()); |
| 51 MOCK_METHOD1(OnMigrationNeededForTypes, void(syncable::ModelTypeSet)); | 51 MOCK_METHOD1(OnMigrationNeededForTypes, void(syncer::ModelTypeSet)); |
| 52 MOCK_METHOD1(OnExperimentsChanged, | 52 MOCK_METHOD1(OnExperimentsChanged, |
| 53 void(const syncer::Experiments&)); | 53 void(const syncer::Experiments&)); |
| 54 MOCK_METHOD1(OnActionableError, | 54 MOCK_METHOD1(OnActionableError, |
| 55 void(const syncer::SyncProtocolError& sync_error)); | 55 void(const syncer::SyncProtocolError& sync_error)); |
| 56 MOCK_METHOD0(OnSyncConfigureRetry, void()); | 56 MOCK_METHOD0(OnSyncConfigureRetry, void()); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 } // namespace | 59 } // namespace |
| 60 | 60 |
| 61 class SyncBackendHostTest : public testing::Test { | 61 class SyncBackendHostTest : public testing::Test { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 invalidator_storage.AsWeakPtr()); | 101 invalidator_storage.AsWeakPtr()); |
| 102 | 102 |
| 103 MockSyncFrontend mock_frontend; | 103 MockSyncFrontend mock_frontend; |
| 104 syncer::SyncCredentials credentials; | 104 syncer::SyncCredentials credentials; |
| 105 credentials.email = "user@example.com"; | 105 credentials.email = "user@example.com"; |
| 106 credentials.sync_token = "sync_token"; | 106 credentials.sync_token = "sync_token"; |
| 107 syncer::TestUnrecoverableErrorHandler handler; | 107 syncer::TestUnrecoverableErrorHandler handler; |
| 108 backend.Initialize(&mock_frontend, | 108 backend.Initialize(&mock_frontend, |
| 109 syncer::WeakHandle<syncer::JsEventHandler>(), | 109 syncer::WeakHandle<syncer::JsEventHandler>(), |
| 110 GURL(k_mock_url), | 110 GURL(k_mock_url), |
| 111 syncable::ModelTypeSet(), | 111 syncer::ModelTypeSet(), |
| 112 credentials, | 112 credentials, |
| 113 true, | 113 true, |
| 114 &handler, | 114 &handler, |
| 115 NULL); | 115 NULL); |
| 116 backend.StopSyncingForShutdown(); | 116 backend.StopSyncingForShutdown(); |
| 117 backend.Shutdown(false); | 117 backend.Shutdown(false); |
| 118 } | 118 } |
| 119 | 119 |
| 120 // TODO(akalin): Write more SyncBackendHost unit tests. | 120 // TODO(akalin): Write more SyncBackendHost unit tests. |
| 121 | 121 |
| 122 } // namespace browser_sync | 122 } // namespace browser_sync |
| OLD | NEW |