Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Side by Side Diff: chrome/browser/signin/signin_manager_unittest.cc

Issue 14029006: Properly handle user cancellation of signin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/signin/signin_manager.h" 5 #include "chrome/browser/signin/signin_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 EXPECT_EQ(0U, google_login_success_.size()); 593 EXPECT_EQ(0U, google_login_success_.size());
594 EXPECT_EQ(3U, google_login_failure_.size()); 594 EXPECT_EQ(3U, google_login_failure_.size());
595 EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty()); 595 EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
596 } 596 }
597 597
598 TEST_F(SigninManagerTest, SignOutMidConnect) { 598 TEST_F(SigninManagerTest, SignOutMidConnect) {
599 manager_->Initialize(profile_.get()); 599 manager_->Initialize(profile_.get());
600 manager_->StartSignIn("username", "password", std::string(), std::string()); 600 manager_->StartSignIn("username", "password", std::string(), std::string());
601 manager_->SignOut(); 601 manager_->SignOut();
602 EXPECT_EQ(0U, google_login_success_.size()); 602 EXPECT_EQ(0U, google_login_success_.size());
603 EXPECT_EQ(0U, google_login_failure_.size()); 603 EXPECT_EQ(1U, google_login_failure_.size());
604 604
605 EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty()); 605 EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
606 } 606 }
607 607
608 TEST_F(SigninManagerTest, SignInWithOAuth) { 608 TEST_F(SigninManagerTest, SignInWithOAuth) {
609 manager_->Initialize(profile_.get()); 609 manager_->Initialize(profile_.get());
610 EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty()); 610 EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
611 611
612 manager_->StartSignInWithOAuth("user@gmail.com", "password"); 612 manager_->StartSignInWithOAuth("user@gmail.com", "password");
613 EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty()); 613 EXPECT_TRUE(manager_->GetAuthenticatedUsername().empty());
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 GURL("http://accounts.google.com/ServiceLogin?service=chromiumsync"))); 677 GURL("http://accounts.google.com/ServiceLogin?service=chromiumsync")));
678 // http, not https, should not be treated as web based signin. 678 // http, not https, should not be treated as web based signin.
679 EXPECT_FALSE(SigninManager::IsWebBasedSigninFlowURL( 679 EXPECT_FALSE(SigninManager::IsWebBasedSigninFlowURL(
680 GURL("http://accounts.google.com/ServiceLogin?service=googlemail"))); 680 GURL("http://accounts.google.com/ServiceLogin?service=googlemail")));
681 // chromiumsync is double-embedded in a continue query param. 681 // chromiumsync is double-embedded in a continue query param.
682 EXPECT_TRUE(SigninManager::IsWebBasedSigninFlowURL( 682 EXPECT_TRUE(SigninManager::IsWebBasedSigninFlowURL(
683 GURL("https://accounts.google.com/CheckCookie?" 683 GURL("https://accounts.google.com/CheckCookie?"
684 "continue=https%3A%2F%2Fwww.google.com%2Fintl%2Fen-US%2Fchrome" 684 "continue=https%3A%2F%2Fwww.google.com%2Fintl%2Fen-US%2Fchrome"
685 "%2Fblank.html%3Fsource%3D3%26nonadv%3D1&service=chromiumsync"))); 685 "%2Fblank.html%3Fsource%3D3%26nonadv%3D1&service=chromiumsync")));
686 } 686 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_manager.cc ('k') | chrome/browser/ui/sync/one_click_signin_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698