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

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

Issue 3846005: Revert 62918 - net: clean up SSLHostInfo construction.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 2 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_network_layer.cc ('k') | net/http/http_network_session.h » ('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/base/mock_host_resolver.h" 5 #include "net/base/mock_host_resolver.h"
6 #include "net/base/net_log.h" 6 #include "net/base/net_log.h"
7 #include "net/base/ssl_config_service_defaults.h" 7 #include "net/base/ssl_config_service_defaults.h"
8 #include "net/http/http_network_layer.h" 8 #include "net/http/http_network_layer.h"
9 #include "net/http/http_transaction_unittest.h" 9 #include "net/http/http_transaction_unittest.h"
10 #include "net/proxy/proxy_service.h" 10 #include "net/proxy/proxy_service.h"
11 #include "net/socket/socket_test_util.h" 11 #include "net/socket/socket_test_util.h"
12 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
13 #include "testing/platform_test.h" 13 #include "testing/platform_test.h"
14 14
15 namespace net { 15 namespace net {
16 16
17 namespace { 17 namespace {
18 18
19 class HttpNetworkLayerTest : public PlatformTest { 19 class HttpNetworkLayerTest : public PlatformTest {
20 }; 20 };
21 21
22 TEST_F(HttpNetworkLayerTest, CreateAndDestroy) { 22 TEST_F(HttpNetworkLayerTest, CreateAndDestroy) {
23 MockHostResolver host_resolver; 23 MockHostResolver host_resolver;
24 net::HttpNetworkLayer factory( 24 net::HttpNetworkLayer factory(
25 NULL, 25 NULL,
26 &host_resolver, 26 &host_resolver,
27 NULL /* dnsrr_resolver */, 27 NULL /* dnsrr_resolver */,
28 NULL /* ssl_host_info_factory */,
29 net::ProxyService::CreateDirect(), 28 net::ProxyService::CreateDirect(),
30 new net::SSLConfigServiceDefaults, 29 new net::SSLConfigServiceDefaults,
31 NULL, 30 NULL,
32 NULL, 31 NULL,
33 NULL); 32 NULL);
34 33
35 scoped_ptr<net::HttpTransaction> trans; 34 scoped_ptr<net::HttpTransaction> trans;
36 int rv = factory.CreateTransaction(&trans); 35 int rv = factory.CreateTransaction(&trans);
37 EXPECT_EQ(net::OK, rv); 36 EXPECT_EQ(net::OK, rv);
38 EXPECT_TRUE(trans.get() != NULL); 37 EXPECT_TRUE(trans.get() != NULL);
39 } 38 }
40 39
41 TEST_F(HttpNetworkLayerTest, Suspend) { 40 TEST_F(HttpNetworkLayerTest, Suspend) {
42 MockHostResolver host_resolver; 41 MockHostResolver host_resolver;
43 net::HttpNetworkLayer factory( 42 net::HttpNetworkLayer factory(
44 NULL, 43 NULL,
45 &host_resolver, 44 &host_resolver,
46 NULL /* dnsrr_resolver */, 45 NULL /* dnsrr_resolver */,
47 NULL /* ssl_host_info_factory */,
48 net::ProxyService::CreateDirect(), 46 net::ProxyService::CreateDirect(),
49 new net::SSLConfigServiceDefaults, 47 new net::SSLConfigServiceDefaults,
50 NULL, 48 NULL,
51 NULL, 49 NULL,
52 NULL); 50 NULL);
53 51
54 scoped_ptr<net::HttpTransaction> trans; 52 scoped_ptr<net::HttpTransaction> trans;
55 int rv = factory.CreateTransaction(&trans); 53 int rv = factory.CreateTransaction(&trans);
56 EXPECT_EQ(net::OK, rv); 54 EXPECT_EQ(net::OK, rv);
57 55
(...skipping 27 matching lines...) Expand all
85 }; 83 };
86 net::StaticSocketDataProvider data(data_reads, arraysize(data_reads), 84 net::StaticSocketDataProvider data(data_reads, arraysize(data_reads),
87 data_writes, arraysize(data_reads)); 85 data_writes, arraysize(data_reads));
88 mock_socket_factory.AddSocketDataProvider(&data); 86 mock_socket_factory.AddSocketDataProvider(&data);
89 87
90 MockHostResolver host_resolver; 88 MockHostResolver host_resolver;
91 net::HttpNetworkLayer factory( 89 net::HttpNetworkLayer factory(
92 &mock_socket_factory, 90 &mock_socket_factory,
93 &host_resolver, 91 &host_resolver,
94 NULL /* dnsrr_resolver */, 92 NULL /* dnsrr_resolver */,
95 NULL /* ssl_host_info_factory */,
96 net::ProxyService::CreateDirect(), 93 net::ProxyService::CreateDirect(),
97 new net::SSLConfigServiceDefaults, 94 new net::SSLConfigServiceDefaults,
98 NULL, 95 NULL,
99 NULL, 96 NULL,
100 NULL); 97 NULL);
101 98
102 TestCompletionCallback callback; 99 TestCompletionCallback callback;
103 100
104 scoped_ptr<net::HttpTransaction> trans; 101 scoped_ptr<net::HttpTransaction> trans;
105 int rv = factory.CreateTransaction(&trans); 102 int rv = factory.CreateTransaction(&trans);
(...skipping 13 matching lines...) Expand all
119 116
120 std::string contents; 117 std::string contents;
121 rv = ReadTransaction(trans.get(), &contents); 118 rv = ReadTransaction(trans.get(), &contents);
122 EXPECT_EQ(net::OK, rv); 119 EXPECT_EQ(net::OK, rv);
123 EXPECT_EQ("hello world", contents); 120 EXPECT_EQ("hello world", contents);
124 } 121 }
125 122
126 } // namespace 123 } // namespace
127 124
128 } // namespace net 125 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_layer.cc ('k') | net/http/http_network_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698