| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifdef CHROME_PERSONALIZATION | 4 #ifdef CHROME_PERSONALIZATION |
| 5 | 5 |
| 6 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
| 8 #include "chrome/browser/tab_contents/tab_contents.h" | 8 #include "chrome/browser/tab_contents/tab_contents.h" |
| 9 #include "chrome/common/pref_names.h" | 9 #include "chrome/common/pref_names.h" |
| 10 #include "chrome/common/pref_service.h" | 10 #include "chrome/common/pref_service.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // Ensure the profile has enough prefs registered for use by sync. | 111 // Ensure the profile has enough prefs registered for use by sync. |
| 112 if (!p->GetPrefs()->IsPrefRegistered(prefs::kAcceptLanguages)) | 112 if (!p->GetPrefs()->IsPrefRegistered(prefs::kAcceptLanguages)) |
| 113 TabContents::RegisterUserPrefs(p->GetPrefs()); | 113 TabContents::RegisterUserPrefs(p->GetPrefs()); |
| 114 if (!p->GetPrefs()->IsPrefRegistered(prefs::kCookieBehavior)) | 114 if (!p->GetPrefs()->IsPrefRegistered(prefs::kCookieBehavior)) |
| 115 Browser::RegisterUserPrefs(p->GetPrefs()); | 115 Browser::RegisterUserPrefs(p->GetPrefs()); |
| 116 } | 116 } |
| 117 | 117 |
| 118 bool ProfileSyncServiceTestHarness::SetupSync() { | 118 bool ProfileSyncServiceTestHarness::SetupSync() { |
| 119 service_ = profile_->GetProfileSyncService(); | 119 service_ = profile_->GetProfileSyncService(); |
| 120 service_->SetSyncSetupCompleted(); | 120 service_->SetSyncSetupCompleted(); |
| 121 service_->EnableForUser(); | 121 service_->EnableForUser(NULL); |
| 122 | 122 |
| 123 // Needed to avoid showing the login dialog. Well aware this is egregious. | 123 // Needed to avoid showing the login dialog. Well aware this is egregious. |
| 124 service_->expecting_first_run_auth_needed_event_ = false; | 124 service_->expecting_first_run_auth_needed_event_ = false; |
| 125 service_->AddObserver(this); | 125 service_->AddObserver(this); |
| 126 return WaitForServiceInit(); | 126 return WaitForServiceInit(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void ProfileSyncServiceTestHarness::SignalStateCompleteWithNextState( | 129 void ProfileSyncServiceTestHarness::SignalStateCompleteWithNextState( |
| 130 WaitState next_state) { | 130 WaitState next_state) { |
| 131 | 131 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 // Wait for the OnBackendInitialized callback. | 244 // Wait for the OnBackendInitialized callback. |
| 245 service_->backend()->Authenticate(username_, password_); | 245 service_->backend()->Authenticate(username_, password_); |
| 246 EXPECT_EQ(wait_state_, WAITING_FOR_READY_TO_PROCESS_CHANGES); | 246 EXPECT_EQ(wait_state_, WAITING_FOR_READY_TO_PROCESS_CHANGES); |
| 247 if (!AwaitStatusChangeWithTimeout(30, "Waiting on backend initialization.")) { | 247 if (!AwaitStatusChangeWithTimeout(30, "Waiting on backend initialization.")) { |
| 248 return false; | 248 return false; |
| 249 } | 249 } |
| 250 return service_->sync_initialized(); | 250 return service_->sync_initialized(); |
| 251 } | 251 } |
| 252 | 252 |
| 253 #endif // CHROME_PERSONALIZATION | 253 #endif // CHROME_PERSONALIZATION |
| OLD | NEW |