| 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 229 |
| 230 // Trigger an event to force state to be cleaned up. | 230 // Trigger an event to force state to be cleaned up. |
| 231 SetContents(NULL); | 231 SetContents(NULL); |
| 232 } | 232 } |
| 233 | 233 |
| 234 // Verify that if the continue_url is to the settings page, no navigation is | 234 // Verify that if the continue_url is to the settings page, no navigation is |
| 235 // triggered, since it would be redundant. | 235 // triggered, since it would be redundant. |
| 236 TEST_F(OneClickSigninSyncObserverTest, | 236 TEST_F(OneClickSigninSyncObserverTest, |
| 237 OnSyncStateChanged_SyncConfiguredSuccessfully_SourceIsSettings) { | 237 OnSyncStateChanged_SyncConfiguredSuccessfully_SourceIsSettings) { |
| 238 GURL continue_url = signin::GetPromoURL( | 238 GURL continue_url = signin::GetPromoURL( |
| 239 signin_metrics::SOURCE_SETTINGS, false); | 239 signin_metrics::AccessPoint::ACCESS_POINT_SETTINGS, |
| 240 signin_metrics::Reason::REASON_SIGNIN_PRIMARY_ACCOUNT, false); |
| 240 CreateSyncObserver(continue_url.spec()); | 241 CreateSyncObserver(continue_url.spec()); |
| 241 sync_service_->set_first_setup_in_progress(false); | 242 sync_service_->set_first_setup_in_progress(false); |
| 242 sync_service_->set_sync_active(true); | 243 sync_service_->set_sync_active(true); |
| 243 | 244 |
| 244 EXPECT_CALL(*web_contents_observer_, | 245 EXPECT_CALL(*web_contents_observer_, |
| 245 DidStartNavigationToPendingEntry(_, _)).Times(0); | 246 DidStartNavigationToPendingEntry(_, _)).Times(0); |
| 246 sync_service_->NotifyObservers(); | 247 sync_service_->NotifyObservers(); |
| 247 EXPECT_NE(GURL(kContinueUrl), web_contents()->GetVisibleURL()); | 248 EXPECT_NE(GURL(kContinueUrl), web_contents()->GetVisibleURL()); |
| 248 } | 249 } |
| OLD | NEW |