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

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

Issue 6166010: net: Remove typedef net::URLRequestStatus URLRequestStatus; (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/sync/signin_manager.h" 5 #include "chrome/browser/sync/signin_manager.h"
6 6
7 #include "chrome/browser/net/gaia/token_service.h" 7 #include "chrome/browser/net/gaia/token_service.h"
8 #include "chrome/browser/net/gaia/token_service_unittest.h" 8 #include "chrome/browser/net/gaia/token_service_unittest.h"
9 #include "chrome/browser/password_manager/encryptor.h" 9 #include "chrome/browser/password_manager/encryptor.h"
10 #include "chrome/browser/webdata/web_data_service.h" 10 #include "chrome/browser/webdata/web_data_service.h"
11 #include "chrome/common/net/test_url_fetcher_factory.h" 11 #include "chrome/common/net/test_url_fetcher_factory.h"
(...skipping 16 matching lines...) Expand all
28 28
29 URLFetcher::set_factory(&factory_); 29 URLFetcher::set_factory(&factory_);
30 } 30 }
31 31
32 void SimulateValidResponse() { 32 void SimulateValidResponse() {
33 // Simulate the correct ClientLogin response. 33 // Simulate the correct ClientLogin response.
34 TestURLFetcher* fetcher = factory_.GetFetcherByID(0); 34 TestURLFetcher* fetcher = factory_.GetFetcherByID(0);
35 DCHECK(fetcher); 35 DCHECK(fetcher);
36 DCHECK(fetcher->delegate()); 36 DCHECK(fetcher->delegate());
37 fetcher->delegate()->OnURLFetchComplete( 37 fetcher->delegate()->OnURLFetchComplete(
38 fetcher, GURL(GaiaAuthFetcher::kClientLoginUrl), URLRequestStatus(), 38 fetcher, GURL(GaiaAuthFetcher::kClientLoginUrl),
39 200, ResponseCookies(), "SID=sid\nLSID=lsid\nAuth=auth"); 39 net::URLRequestStatus(), 200, ResponseCookies(),
40 "SID=sid\nLSID=lsid\nAuth=auth");
40 41
41 // Then simulate the correct GetUserInfo response for the canonical email. 42 // Then simulate the correct GetUserInfo response for the canonical email.
42 // A new URL fetcher is used for each call. 43 // A new URL fetcher is used for each call.
43 fetcher = factory_.GetFetcherByID(0); 44 fetcher = factory_.GetFetcherByID(0);
44 DCHECK(fetcher); 45 DCHECK(fetcher);
45 DCHECK(fetcher->delegate()); 46 DCHECK(fetcher->delegate());
46 fetcher->delegate()->OnURLFetchComplete( 47 fetcher->delegate()->OnURLFetchComplete(
47 fetcher, GURL(GaiaAuthFetcher::kGetUserInfoUrl), URLRequestStatus(), 48 fetcher, GURL(GaiaAuthFetcher::kGetUserInfoUrl),
48 200, ResponseCookies(), "email=user@gmail.com"); 49 net::URLRequestStatus(), 200, ResponseCookies(),
50 "email=user@gmail.com");
49 } 51 }
50 52
51 53
52 TestURLFetcherFactory factory_; 54 TestURLFetcherFactory factory_;
53 scoped_ptr<SigninManager> manager_; 55 scoped_ptr<SigninManager> manager_;
54 TestNotificationTracker google_login_success_; 56 TestNotificationTracker google_login_success_;
55 TestNotificationTracker google_login_failure_; 57 TestNotificationTracker google_login_failure_;
56 }; 58 };
57 59
58 TEST_F(SigninManagerTest, SignIn) { 60 TEST_F(SigninManagerTest, SignIn) {
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 157
156 TEST_F(SigninManagerTest, SignOutMidConnect) { 158 TEST_F(SigninManagerTest, SignOutMidConnect) {
157 manager_->Initialize(profile_.get()); 159 manager_->Initialize(profile_.get());
158 manager_->StartSignIn("username", "password", "", ""); 160 manager_->StartSignIn("username", "password", "", "");
159 manager_->SignOut(); 161 manager_->SignOut();
160 EXPECT_EQ(0U, google_login_success_.size()); 162 EXPECT_EQ(0U, google_login_success_.size());
161 EXPECT_EQ(0U, google_login_failure_.size()); 163 EXPECT_EQ(0U, google_login_failure_.size());
162 164
163 EXPECT_TRUE(manager_->GetUsername().empty()); 165 EXPECT_TRUE(manager_->GetUsername().empty());
164 } 166 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/http_bridge_unittest.cc ('k') | chrome/browser/task_manager/task_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698