| 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/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 TEST_F(SyncBackendHostTest, InitShutdown) { | 76 TEST_F(SyncBackendHostTest, InitShutdown) { |
| 77 TestingProfile profile; | 77 TestingProfile profile; |
| 78 profile.CreateRequestContext(); | 78 profile.CreateRequestContext(); |
| 79 | 79 |
| 80 SyncBackendHost backend(&profile); | 80 SyncBackendHost backend(&profile); |
| 81 | 81 |
| 82 // TODO(akalin): Handle this in SyncBackendHost instead of in | 82 // TODO(akalin): Handle this in SyncBackendHost instead of in |
| 83 // ProfileSyncService, or maybe figure out a way to share the | 83 // ProfileSyncService, or maybe figure out a way to share the |
| 84 // "register sync prefs" code. | 84 // "register sync prefs" code. |
| 85 PrefService* pref_service = profile.GetPrefs(); | 85 PrefService* pref_service = profile.GetPrefs(); |
| 86 pref_service->RegisterStringPref(prefs::kEncryptionBootstrapToken, ""); | 86 pref_service->RegisterStringPref(prefs::kEncryptionBootstrapToken, |
| 87 "", |
| 88 false /* don't sync pref */); |
| 87 | 89 |
| 88 MockSyncFrontend mock_frontend; | 90 MockSyncFrontend mock_frontend; |
| 89 sync_api::SyncCredentials credentials; | 91 sync_api::SyncCredentials credentials; |
| 90 credentials.email = "user@example.com"; | 92 credentials.email = "user@example.com"; |
| 91 credentials.sync_token = "sync_token"; | 93 credentials.sync_token = "sync_token"; |
| 92 backend.Initialize(&mock_frontend, | 94 backend.Initialize(&mock_frontend, |
| 93 GURL("http://www.example.com"), | 95 GURL("http://www.example.com"), |
| 94 syncable::ModelTypeSet(), | 96 syncable::ModelTypeSet(), |
| 95 profile.GetRequestContext(), | 97 profile.GetRequestContext(), |
| 96 credentials, | 98 credentials, |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 EXPECT_FALSE(state->ready_task.get()); | 196 EXPECT_FALSE(state->ready_task.get()); |
| 195 EXPECT_EQ(types, state->initial_types); | 197 EXPECT_EQ(types, state->initial_types); |
| 196 EXPECT_TRUE(state->deleted_type); | 198 EXPECT_TRUE(state->deleted_type); |
| 197 EXPECT_TRUE(state->added_types.none()); | 199 EXPECT_TRUE(state->added_types.none()); |
| 198 } | 200 } |
| 199 } | 201 } |
| 200 | 202 |
| 201 // TODO(akalin): Write more SyncBackendHost unit tests. | 203 // TODO(akalin): Write more SyncBackendHost unit tests. |
| 202 | 204 |
| 203 } // namespace browser_sync | 205 } // namespace browser_sync |
| OLD | NEW |