| 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 "net/base/mock_host_resolver.h" | 5 #include "net/base/mock_host_resolver.h" |
| 6 #include "net/http/http_network_layer.h" | 6 #include "net/http/http_network_layer.h" |
| 7 #include "net/http/http_transaction_unittest.h" | 7 #include "net/http/http_transaction_unittest.h" |
| 8 #include "net/proxy/proxy_service.h" | 8 #include "net/proxy/proxy_service.h" |
| 9 #include "net/socket/socket_test_util.h" | 9 #include "net/socket/socket_test_util.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 TestCompletionCallback callback; | 62 TestCompletionCallback callback; |
| 63 | 63 |
| 64 scoped_ptr<net::HttpTransaction> trans(factory.CreateTransaction()); | 64 scoped_ptr<net::HttpTransaction> trans(factory.CreateTransaction()); |
| 65 | 65 |
| 66 net::HttpRequestInfo request_info; | 66 net::HttpRequestInfo request_info; |
| 67 request_info.url = GURL("http://www.google.com/"); | 67 request_info.url = GURL("http://www.google.com/"); |
| 68 request_info.method = "GET"; | 68 request_info.method = "GET"; |
| 69 request_info.user_agent = "Foo/1.0"; | 69 request_info.user_agent = "Foo/1.0"; |
| 70 request_info.load_flags = net::LOAD_NORMAL; | 70 request_info.load_flags = net::LOAD_NORMAL; |
| 71 | 71 |
| 72 int rv = trans->Start(&request_info, &callback); | 72 int rv = trans->Start(NULL, &request_info, &callback); |
| 73 if (rv == net::ERR_IO_PENDING) | 73 if (rv == net::ERR_IO_PENDING) |
| 74 rv = callback.WaitForResult(); | 74 rv = callback.WaitForResult(); |
| 75 ASSERT_EQ(net::OK, rv); | 75 ASSERT_EQ(net::OK, rv); |
| 76 | 76 |
| 77 std::string contents; | 77 std::string contents; |
| 78 rv = ReadTransaction(trans.get(), &contents); | 78 rv = ReadTransaction(trans.get(), &contents); |
| 79 EXPECT_EQ(net::OK, rv); | 79 EXPECT_EQ(net::OK, rv); |
| 80 EXPECT_EQ("hello world", contents); | 80 EXPECT_EQ("hello world", contents); |
| 81 } | 81 } |
| OLD | NEW |