OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/startup_controller.h" | 5 #include "chrome/browser/sync/startup_controller.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 EXPECT_TRUE(started()); | 184 EXPECT_TRUE(started()); |
185 } | 185 } |
186 | 186 |
187 // Test that we start immediately if sessions is disabled. | 187 // Test that we start immediately if sessions is disabled. |
188 TEST_F(StartupControllerTest, NoDeferralWithoutSessionsSync) { | 188 TEST_F(StartupControllerTest, NoDeferralWithoutSessionsSync) { |
189 syncer::ModelTypeSet types(syncer::UserTypes()); | 189 syncer::ModelTypeSet types(syncer::UserTypes()); |
190 // Disabling sessions means disabling 4 types due to groupings. | 190 // Disabling sessions means disabling 4 types due to groupings. |
191 types.Remove(syncer::SESSIONS); | 191 types.Remove(syncer::SESSIONS); |
192 types.Remove(syncer::PROXY_TABS); | 192 types.Remove(syncer::PROXY_TABS); |
193 types.Remove(syncer::TYPED_URLS); | 193 types.Remove(syncer::TYPED_URLS); |
194 types.Remove(syncer::MANAGED_USER_SETTINGS); | 194 types.Remove(syncer::SUPERVISED_USER_SETTINGS); |
195 sync_prefs()->SetKeepEverythingSynced(false); | 195 sync_prefs()->SetKeepEverythingSynced(false); |
196 sync_prefs()->SetPreferredDataTypes(syncer::UserTypes(), types); | 196 sync_prefs()->SetPreferredDataTypes(syncer::UserTypes(), types); |
197 controller()->Reset(syncer::UserTypes()); | 197 controller()->Reset(syncer::UserTypes()); |
198 sync_prefs()->SetSyncSetupCompleted(); | 198 sync_prefs()->SetSyncSetupCompleted(); |
199 signin()->set_account(kTestUser); | 199 signin()->set_account(kTestUser); |
200 token_service()->IssueRefreshTokenForUser(kTestUser, kTestToken); | 200 token_service()->IssueRefreshTokenForUser(kTestUser, kTestToken); |
201 controller()->TryStart(); | 201 controller()->TryStart(); |
202 EXPECT_TRUE(started()); | 202 EXPECT_TRUE(started()); |
203 } | 203 } |
204 | 204 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 controller()->set_setup_in_progress(true); | 256 controller()->set_setup_in_progress(true); |
257 | 257 |
258 // This could happen if the UI triggers a stop-syncing permanently call. | 258 // This could happen if the UI triggers a stop-syncing permanently call. |
259 controller()->Reset(syncer::UserTypes()); | 259 controller()->Reset(syncer::UserTypes()); |
260 | 260 |
261 // From the UI's point of view, setup is still in progress. | 261 // From the UI's point of view, setup is still in progress. |
262 EXPECT_TRUE(controller()->setup_in_progress()); | 262 EXPECT_TRUE(controller()->setup_in_progress()); |
263 } | 263 } |
264 | 264 |
265 } // namespace browser_sync | 265 } // namespace browser_sync |
OLD | NEW |