OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/message_loop_proxy.h" | 12 #include "base/message_loop_proxy.h" |
13 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
14 #include "base/stringprintf.h" | 14 #include "base/stringprintf.h" |
15 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
17 #include "chrome/test/chromedriver/net/net_util.h" | 17 #include "chrome/test/chromedriver/net/net_util.h" |
18 #include "chrome/test/chromedriver/net/url_request_context_getter.h" | 18 #include "chrome/test/chromedriver/net/url_request_context_getter.h" |
19 #include "net/base/ip_endpoint.h" | 19 #include "net/base/ip_endpoint.h" |
20 #include "net/base/net_errors.h" | 20 #include "net/base/net_errors.h" |
21 #include "net/base/tcp_listen_socket.h" | |
22 #include "net/server/http_server.h" | 21 #include "net/server/http_server.h" |
23 #include "net/server/http_server_request_info.h" | 22 #include "net/server/http_server_request_info.h" |
| 23 #include "net/socket/tcp_listen_socket.h" |
24 #include "net/url_request/url_request_context_getter.h" | 24 #include "net/url_request/url_request_context_getter.h" |
25 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 class FetchUrlTest : public testing::Test, | 29 class FetchUrlTest : public testing::Test, |
30 public net::HttpServer::Delegate { | 30 public net::HttpServer::Delegate { |
31 public: | 31 public: |
32 FetchUrlTest() | 32 FetchUrlTest() |
33 : io_thread_("io"), | 33 : io_thread_("io"), |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 std::string response("stuff"); | 129 std::string response("stuff"); |
130 ASSERT_FALSE(FetchUrl(server_url_, context_getter_, &response)); | 130 ASSERT_FALSE(FetchUrl(server_url_, context_getter_, &response)); |
131 ASSERT_STREQ("stuff", response.c_str()); | 131 ASSERT_STREQ("stuff", response.c_str()); |
132 } | 132 } |
133 | 133 |
134 TEST_F(FetchUrlTest, NoServer) { | 134 TEST_F(FetchUrlTest, NoServer) { |
135 std::string response("stuff"); | 135 std::string response("stuff"); |
136 ASSERT_FALSE(FetchUrl("http://localhost:33333", context_getter_, &response)); | 136 ASSERT_FALSE(FetchUrl("http://localhost:33333", context_getter_, &response)); |
137 ASSERT_STREQ("stuff", response.c_str()); | 137 ASSERT_STREQ("stuff", response.c_str()); |
138 } | 138 } |
OLD | NEW |