OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/compiler_specific.h" | 5 #include "base/compiler_specific.h" |
6 #include "base/platform_test.h" | 6 #include "base/platform_test.h" |
7 #include "net/base/client_socket_factory.h" | 7 #include "net/base/client_socket_factory.h" |
8 #include "net/base/test_completion_callback.h" | 8 #include "net/base/test_completion_callback.h" |
9 #include "net/base/upload_data.h" | 9 #include "net/base/upload_data.h" |
10 #include "net/http/http_network_session.h" | 10 #include "net/http/http_network_session.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 const std::string& pac_url, | 155 const std::string& pac_url, |
156 net::ProxyInfo* results) { | 156 net::ProxyInfo* results) { |
157 return net::ERR_FAILED; | 157 return net::ERR_FAILED; |
158 } | 158 } |
159 }; | 159 }; |
160 | 160 |
161 net::HttpNetworkSession* CreateSession() { | 161 net::HttpNetworkSession* CreateSession() { |
162 return new net::HttpNetworkSession(new NullProxyResolver()); | 162 return new net::HttpNetworkSession(new NullProxyResolver()); |
163 } | 163 } |
164 | 164 |
165 class HttpNetworkTransactionTest : public testing::Test { | 165 class HttpNetworkTransactionTest : public PlatformTest { |
166 public: | 166 public: |
167 virtual void SetUp() { | 167 virtual void SetUp() { |
| 168 PlatformTest::SetUp(); |
168 mock_sockets[0] = NULL; | 169 mock_sockets[0] = NULL; |
169 mock_sockets_index = 0; | 170 mock_sockets_index = 0; |
170 } | 171 } |
171 }; | 172 }; |
172 | 173 |
173 struct SimpleGetHelperResult { | 174 struct SimpleGetHelperResult { |
174 std::string status_line; | 175 std::string status_line; |
175 std::string response_data; | 176 std::string response_data; |
176 }; | 177 }; |
177 | 178 |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
482 rv = ReadTransaction(trans, &response_data); | 483 rv = ReadTransaction(trans, &response_data); |
483 EXPECT_EQ(net::OK, rv); | 484 EXPECT_EQ(net::OK, rv); |
484 EXPECT_TRUE(response_data == kExpectedResponseData[i]); | 485 EXPECT_TRUE(response_data == kExpectedResponseData[i]); |
485 | 486 |
486 trans->Destroy(); | 487 trans->Destroy(); |
487 | 488 |
488 // Empty the current queue. | 489 // Empty the current queue. |
489 MessageLoop::current()->RunAllPending(); | 490 MessageLoop::current()->RunAllPending(); |
490 } | 491 } |
491 } | 492 } |
OLD | NEW |