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

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

Issue 1783008: Cleanup: Remove the implicit constructor for BoundNetLog that allowed passing... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Sync Created 10 years, 7 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/ftp/ftp_network_transaction_unittest.cc ('k') | net/http/http_cache.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_negotiate.h" 5 #include "net/http/http_auth_handler_negotiate.h"
6 6
7 #include "net/base/mock_host_resolver.h" 7 #include "net/base/mock_host_resolver.h"
8 #include "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 #include "net/base/test_completion_callback.h" 9 #include "net/base/test_completion_callback.h"
10 #if defined(OS_WIN) 10 #if defined(OS_WIN)
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 scoped_refptr<HttpAuthHandlerNegotiate> auth_handler; 63 scoped_refptr<HttpAuthHandlerNegotiate> auth_handler;
64 CreateHandler(false, false, "http://alias:500", &mock_library, &auth_handler); 64 CreateHandler(false, false, "http://alias:500", &mock_library, &auth_handler);
65 EXPECT_TRUE(auth_handler->NeedsCanonicalName()); 65 EXPECT_TRUE(auth_handler->NeedsCanonicalName());
66 MockHostResolver* mock_resolver = new MockHostResolver(); 66 MockHostResolver* mock_resolver = new MockHostResolver();
67 scoped_refptr<HostResolver> scoped_resolver(mock_resolver); 67 scoped_refptr<HostResolver> scoped_resolver(mock_resolver);
68 mock_resolver->set_synchronous_mode(true); 68 mock_resolver->set_synchronous_mode(true);
69 mock_resolver->rules()->AddIPv4Rule("alias", "10.0.0.2", 69 mock_resolver->rules()->AddIPv4Rule("alias", "10.0.0.2",
70 "canonical.example.com"); 70 "canonical.example.com");
71 TestCompletionCallback callback; 71 TestCompletionCallback callback;
72 EXPECT_EQ(OK, auth_handler->ResolveCanonicalName(mock_resolver, &callback, 72 EXPECT_EQ(OK, auth_handler->ResolveCanonicalName(mock_resolver, &callback,
73 NULL)); 73 BoundNetLog()));
74 EXPECT_EQ(L"HTTP/canonical.example.com", auth_handler->spn()); 74 EXPECT_EQ(L"HTTP/canonical.example.com", auth_handler->spn());
75 } 75 }
76 76
77 TEST(HttpAuthHandlerNegotiateTest, CnameAsync) { 77 TEST(HttpAuthHandlerNegotiateTest, CnameAsync) {
78 MockSSPILibrary mock_library; 78 MockSSPILibrary mock_library;
79 scoped_refptr<HttpAuthHandlerNegotiate> auth_handler; 79 scoped_refptr<HttpAuthHandlerNegotiate> auth_handler;
80 CreateHandler(false, false, "http://alias:500", &mock_library, &auth_handler); 80 CreateHandler(false, false, "http://alias:500", &mock_library, &auth_handler);
81 EXPECT_TRUE(auth_handler->NeedsCanonicalName()); 81 EXPECT_TRUE(auth_handler->NeedsCanonicalName());
82 MockHostResolver* mock_resolver = new MockHostResolver(); 82 MockHostResolver* mock_resolver = new MockHostResolver();
83 scoped_refptr<HostResolver> scoped_resolver(mock_resolver); 83 scoped_refptr<HostResolver> scoped_resolver(mock_resolver);
84 mock_resolver->set_synchronous_mode(false); 84 mock_resolver->set_synchronous_mode(false);
85 mock_resolver->rules()->AddIPv4Rule("alias", "10.0.0.2", 85 mock_resolver->rules()->AddIPv4Rule("alias", "10.0.0.2",
86 "canonical.example.com"); 86 "canonical.example.com");
87 TestCompletionCallback callback; 87 TestCompletionCallback callback;
88 EXPECT_EQ(ERR_IO_PENDING, auth_handler->ResolveCanonicalName(mock_resolver, 88 EXPECT_EQ(ERR_IO_PENDING, auth_handler->ResolveCanonicalName(mock_resolver,
89 &callback, 89 &callback,
90 NULL)); 90 BoundNetLog()));
91 EXPECT_EQ(OK, callback.WaitForResult()); 91 EXPECT_EQ(OK, callback.WaitForResult());
92 EXPECT_EQ(L"HTTP/canonical.example.com", auth_handler->spn()); 92 EXPECT_EQ(L"HTTP/canonical.example.com", auth_handler->spn());
93 } 93 }
94 #endif // defined(OS_WIN) 94 #endif // defined(OS_WIN)
95 95
96 } // namespace net 96 } // namespace net
OLDNEW
« no previous file with comments | « net/ftp/ftp_network_transaction_unittest.cc ('k') | net/http/http_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698