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

Side by Side Diff: net/http/http_auth_handler_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_handler_ntlm_portable.cc ('k') | net/http/http_content_disposition.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) 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 "net/http/http_auth_handler.h" 5 #include "net/http/http_auth_handler.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "net/base/capturing_net_log.h" 9 #include "net/base/capturing_net_log.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
11 #include "net/base/net_log_unittest.h" 11 #include "net/base/net_log_unittest.h"
12 #include "net/base/test_completion_callback.h" 12 #include "net/base/test_completion_callback.h"
13 #include "net/http/http_auth_handler_mock.h" 13 #include "net/http/http_auth_handler_mock.h"
14 #include "net/http/http_request_info.h" 14 #include "net/http/http_request_info.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 namespace net { 17 namespace net {
18 18
19 TEST(HttpAuthHandlerTest, NetLog) { 19 TEST(HttpAuthHandlerTest, NetLog) {
20 GURL origin("http://www.example.com"); 20 GURL origin("http://www.example.com");
21 std::string challenge = "Mock asdf"; 21 std::string challenge = "Mock asdf";
22 AuthCredentials credentials(ASCIIToUTF16("user"), ASCIIToUTF16("pass")); 22 AuthCredentials credentials(base::ASCIIToUTF16("user"),
23 base::ASCIIToUTF16("pass"));
23 std::string auth_token; 24 std::string auth_token;
24 HttpRequestInfo request; 25 HttpRequestInfo request;
25 26
26 for (int i = 0; i < 2; ++i) { 27 for (int i = 0; i < 2; ++i) {
27 bool async = (i == 0); 28 bool async = (i == 0);
28 for (int j = 0; j < 2; ++j) { 29 for (int j = 0; j < 2; ++j) {
29 int rv = (j == 0) ? OK : ERR_UNEXPECTED; 30 int rv = (j == 0) ? OK : ERR_UNEXPECTED;
30 for (int k = 0; k < 2; ++k) { 31 for (int k = 0; k < 2; ++k) {
31 TestCompletionCallback test_callback; 32 TestCompletionCallback test_callback;
32 HttpAuth::Target target = 33 HttpAuth::Target target =
(...skipping 20 matching lines...) Expand all
53 54
54 EXPECT_EQ(2u, entries.size()); 55 EXPECT_EQ(2u, entries.size());
55 EXPECT_TRUE(LogContainsBeginEvent(entries, 0, event_type)); 56 EXPECT_TRUE(LogContainsBeginEvent(entries, 0, event_type));
56 EXPECT_TRUE(LogContainsEndEvent(entries, 1, event_type)); 57 EXPECT_TRUE(LogContainsEndEvent(entries, 1, event_type));
57 } 58 }
58 } 59 }
59 } 60 }
60 } 61 }
61 62
62 } // namespace net 63 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_auth_handler_ntlm_portable.cc ('k') | net/http/http_content_disposition.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698