OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "chrome/test/chromedriver/net/test_http_server.h" | 5 #include "chrome/test/chromedriver/net/test_http_server.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
11 #include "base/stringprintf.h" | 11 #include "base/stringprintf.h" |
12 #include "base/time.h" | 12 #include "base/time.h" |
13 #include "net/base/ip_endpoint.h" | 13 #include "net/base/ip_endpoint.h" |
14 #include "net/base/net_errors.h" | 14 #include "net/base/net_errors.h" |
15 #include "net/base/tcp_listen_socket.h" | |
16 #include "net/server/http_server_request_info.h" | 15 #include "net/server/http_server_request_info.h" |
| 16 #include "net/socket/tcp_listen_socket.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 TestHttpServer::TestHttpServer() | 19 TestHttpServer::TestHttpServer() |
20 : thread_("ServerThread"), | 20 : thread_("ServerThread"), |
21 all_closed_event_(false, true), | 21 all_closed_event_(false, true), |
22 request_action_(kAccept), | 22 request_action_(kAccept), |
23 message_action_(kEchoMessage) { | 23 message_action_(kEchoMessage) { |
24 } | 24 } |
25 | 25 |
26 TestHttpServer::~TestHttpServer() { | 26 TestHttpServer::~TestHttpServer() { |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } | 143 } |
144 *success = server_; | 144 *success = server_; |
145 event->Signal(); | 145 event->Signal(); |
146 } | 146 } |
147 | 147 |
148 void TestHttpServer::StopOnServerThread(base::WaitableEvent* event) { | 148 void TestHttpServer::StopOnServerThread(base::WaitableEvent* event) { |
149 if (server_) | 149 if (server_) |
150 server_ = NULL; | 150 server_ = NULL; |
151 event->Signal(); | 151 event->Signal(); |
152 } | 152 } |
OLD | NEW |