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

Side by Side Diff: net/http/http_auth_controller_unittest.cc

Issue 112963005: Update uses of UTF conversions in courgette/, device/, extensions/, google_apis/, gpu/, ipc/, media… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 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
« no previous file with comments | « net/http/http_auth_cache_unittest.cc ('k') | net/http/http_auth_handler_basic.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 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 "net/http/http_auth_controller.h" 5 #include "net/http/http_auth_controller.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 #include "net/base/net_log.h" 9 #include "net/base/net_log.h"
10 #include "net/base/test_completion_callback.h" 10 #include "net/base/test_completion_callback.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // Should only succeed if we are using the AUTH_SCHEME_MOCK MockHandler. 217 // Should only succeed if we are using the AUTH_SCHEME_MOCK MockHandler.
218 EXPECT_EQ(OK, controller->MaybeGenerateAuthToken( 218 EXPECT_EQ(OK, controller->MaybeGenerateAuthToken(
219 &request, CompletionCallback(), dummy_log)); 219 &request, CompletionCallback(), dummy_log));
220 controller->AddAuthorizationHeader(&request_headers); 220 controller->AddAuthorizationHeader(&request_headers);
221 221
222 // Once a token is generated, simulate the receipt of a server response 222 // Once a token is generated, simulate the receipt of a server response
223 // indicating that the authentication attempt was rejected. 223 // indicating that the authentication attempt was rejected.
224 ASSERT_EQ(OK, 224 ASSERT_EQ(OK,
225 controller->HandleAuthChallenge(headers, false, false, dummy_log)); 225 controller->HandleAuthChallenge(headers, false, false, dummy_log));
226 ASSERT_TRUE(controller->HaveAuthHandler()); 226 ASSERT_TRUE(controller->HaveAuthHandler());
227 controller->ResetAuth(AuthCredentials(ASCIIToUTF16("Hello"), 227 controller->ResetAuth(AuthCredentials(base::ASCIIToUTF16("Hello"),
228 base::string16())); 228 base::string16()));
229 EXPECT_TRUE(controller->HaveAuth()); 229 EXPECT_TRUE(controller->HaveAuth());
230 EXPECT_TRUE(controller->IsAuthSchemeDisabled(HttpAuth::AUTH_SCHEME_MOCK)); 230 EXPECT_TRUE(controller->IsAuthSchemeDisabled(HttpAuth::AUTH_SCHEME_MOCK));
231 EXPECT_FALSE(controller->IsAuthSchemeDisabled(HttpAuth::AUTH_SCHEME_BASIC)); 231 EXPECT_FALSE(controller->IsAuthSchemeDisabled(HttpAuth::AUTH_SCHEME_BASIC));
232 232
233 // Should only succeed if we are using the AUTH_SCHEME_BASIC MockHandler. 233 // Should only succeed if we are using the AUTH_SCHEME_BASIC MockHandler.
234 EXPECT_EQ(OK, controller->MaybeGenerateAuthToken( 234 EXPECT_EQ(OK, controller->MaybeGenerateAuthToken(
235 &request, CompletionCallback(), dummy_log)); 235 &request, CompletionCallback(), dummy_log));
236 } 236 }
237 237
238 } // namespace net 238 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_cache_unittest.cc ('k') | net/http/http_auth_handler_basic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698