| 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 "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 9 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 10 #include "chrome/browser/signin/signin_manager_factory.h" | 10 #include "chrome/browser/signin/signin_manager_factory.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 EXPECT_NE(GURL(kContinueUrl), web_contents()->GetVisibleURL()); | 225 EXPECT_NE(GURL(kContinueUrl), web_contents()->GetVisibleURL()); |
| 226 | 226 |
| 227 // Trigger an event to force state to be cleaned up. | 227 // Trigger an event to force state to be cleaned up. |
| 228 SetContents(NULL); | 228 SetContents(NULL); |
| 229 } | 229 } |
| 230 | 230 |
| 231 // Verify that if the continue_url is to the settings page, no navigation is | 231 // Verify that if the continue_url is to the settings page, no navigation is |
| 232 // triggered, since it would be redundant. | 232 // triggered, since it would be redundant. |
| 233 TEST_F(OneClickSigninSyncObserverTest, | 233 TEST_F(OneClickSigninSyncObserverTest, |
| 234 OnSyncStateChanged_SyncConfiguredSuccessfully_SourceIsSettings) { | 234 OnSyncStateChanged_SyncConfiguredSuccessfully_SourceIsSettings) { |
| 235 GURL continue_url = signin::GetPromoURL(signin::SOURCE_SETTINGS, false); | 235 GURL continue_url = signin::GetPromoURL( |
| 236 signin_metrics::SOURCE_SETTINGS, false); |
| 236 CreateSyncObserver(continue_url.spec()); | 237 CreateSyncObserver(continue_url.spec()); |
| 237 sync_service_->set_first_setup_in_progress(false); | 238 sync_service_->set_first_setup_in_progress(false); |
| 238 sync_service_->set_sync_active(true); | 239 sync_service_->set_sync_active(true); |
| 239 | 240 |
| 240 EXPECT_CALL(*web_contents_observer_, AboutToNavigateRenderFrame(_)).Times(0); | 241 EXPECT_CALL(*web_contents_observer_, AboutToNavigateRenderFrame(_)).Times(0); |
| 241 sync_service_->NotifyObservers(); | 242 sync_service_->NotifyObservers(); |
| 242 EXPECT_NE(GURL(kContinueUrl), web_contents()->GetVisibleURL()); | 243 EXPECT_NE(GURL(kContinueUrl), web_contents()->GetVisibleURL()); |
| 243 } | 244 } |
| OLD | NEW |