| OLD | NEW |
| 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/ssl_config_service_defaults.h" | 7 #include "net/base/ssl_config_service_defaults.h" |
| 7 #include "net/http/http_network_layer.h" | 8 #include "net/http/http_network_layer.h" |
| 8 #include "net/http/http_transaction_unittest.h" | 9 #include "net/http/http_transaction_unittest.h" |
| 9 #include "net/proxy/proxy_service.h" | 10 #include "net/proxy/proxy_service.h" |
| 10 #include "net/socket/socket_test_util.h" | 11 #include "net/socket/socket_test_util.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 12 #include "testing/platform_test.h" | 13 #include "testing/platform_test.h" |
| 13 | 14 |
| 14 class HttpNetworkLayerTest : public PlatformTest { | 15 class HttpNetworkLayerTest : public PlatformTest { |
| 15 }; | 16 }; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 scoped_ptr<net::HttpTransaction> trans; | 78 scoped_ptr<net::HttpTransaction> trans; |
| 78 int rv = factory.CreateTransaction(&trans); | 79 int rv = factory.CreateTransaction(&trans); |
| 79 EXPECT_EQ(net::OK, rv); | 80 EXPECT_EQ(net::OK, rv); |
| 80 | 81 |
| 81 net::HttpRequestInfo request_info; | 82 net::HttpRequestInfo request_info; |
| 82 request_info.url = GURL("http://www.google.com/"); | 83 request_info.url = GURL("http://www.google.com/"); |
| 83 request_info.method = "GET"; | 84 request_info.method = "GET"; |
| 84 request_info.user_agent = "Foo/1.0"; | 85 request_info.user_agent = "Foo/1.0"; |
| 85 request_info.load_flags = net::LOAD_NORMAL; | 86 request_info.load_flags = net::LOAD_NORMAL; |
| 86 | 87 |
| 87 rv = trans->Start(&request_info, &callback, NULL); | 88 rv = trans->Start(&request_info, &callback, net::BoundNetLog()); |
| 88 if (rv == net::ERR_IO_PENDING) | 89 if (rv == net::ERR_IO_PENDING) |
| 89 rv = callback.WaitForResult(); | 90 rv = callback.WaitForResult(); |
| 90 ASSERT_EQ(net::OK, rv); | 91 ASSERT_EQ(net::OK, rv); |
| 91 | 92 |
| 92 std::string contents; | 93 std::string contents; |
| 93 rv = ReadTransaction(trans.get(), &contents); | 94 rv = ReadTransaction(trans.get(), &contents); |
| 94 EXPECT_EQ(net::OK, rv); | 95 EXPECT_EQ(net::OK, rv); |
| 95 EXPECT_EQ("hello world", contents); | 96 EXPECT_EQ("hello world", contents); |
| 96 } | 97 } |
| OLD | NEW |