| 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/ui/sync/one_click_signin_sync_observer.h" | 5 #include "chrome/browser/ui/sync/one_click_signin_sync_observer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 10 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 first_setup_in_progress_ = in_progress; | 64 first_setup_in_progress_ = in_progress; |
| 65 } | 65 } |
| 66 | 66 |
| 67 void set_sync_active(bool active) { | 67 void set_sync_active(bool active) { |
| 68 sync_active_ = active; | 68 sync_active_ = active; |
| 69 } | 69 } |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 explicit OneClickTestProfileSyncService(Profile* profile) | 72 explicit OneClickTestProfileSyncService(Profile* profile) |
| 73 : TestProfileSyncService( | 73 : TestProfileSyncService( |
| 74 scoped_ptr<ProfileSyncComponentsFactory>( | 74 scoped_ptr<sync_driver::SyncApiComponentFactory>( |
| 75 new ProfileSyncComponentsFactoryMock()), | 75 new ProfileSyncComponentsFactoryMock()), |
| 76 profile, | 76 profile, |
| 77 SigninManagerFactory::GetForProfile(profile), | 77 SigninManagerFactory::GetForProfile(profile), |
| 78 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), | 78 ProfileOAuth2TokenServiceFactory::GetForProfile(profile), |
| 79 browser_sync::MANUAL_START), | 79 browser_sync::MANUAL_START), |
| 80 first_setup_in_progress_(false), | 80 first_setup_in_progress_(false), |
| 81 sync_active_(false) {} | 81 sync_active_(false) {} |
| 82 | 82 |
| 83 bool first_setup_in_progress_; | 83 bool first_setup_in_progress_; |
| 84 bool sync_active_; | 84 bool sync_active_; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 signin_metrics::SOURCE_SETTINGS, false); | 242 signin_metrics::SOURCE_SETTINGS, false); |
| 243 CreateSyncObserver(continue_url.spec()); | 243 CreateSyncObserver(continue_url.spec()); |
| 244 sync_service_->set_first_setup_in_progress(false); | 244 sync_service_->set_first_setup_in_progress(false); |
| 245 sync_service_->set_sync_active(true); | 245 sync_service_->set_sync_active(true); |
| 246 | 246 |
| 247 EXPECT_CALL(*web_contents_observer_, | 247 EXPECT_CALL(*web_contents_observer_, |
| 248 AboutToNavigateRenderFrame(_, _)).Times(0); | 248 AboutToNavigateRenderFrame(_, _)).Times(0); |
| 249 sync_service_->NotifyObservers(); | 249 sync_service_->NotifyObservers(); |
| 250 EXPECT_NE(GURL(kContinueUrl), web_contents()->GetVisibleURL()); | 250 EXPECT_NE(GURL(kContinueUrl), web_contents()->GetVisibleURL()); |
| 251 } | 251 } |
| OLD | NEW |