OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_TEST_BASE_LAYOUT_TEST_HTTP_SERVER_H_ | 5 #ifndef CHROME_TEST_BASE_LAYOUT_TEST_HTTP_SERVER_H_ |
6 #define CHROME_TEST_BASE_LAYOUT_TEST_HTTP_SERVER_H_ | 6 #define CHROME_TEST_BASE_LAYOUT_TEST_HTTP_SERVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 bool Start() WARN_UNUSED_RESULT; | 27 bool Start() WARN_UNUSED_RESULT; |
28 | 28 |
29 // Stops the server. Returns true on success. | 29 // Stops the server. Returns true on success. |
30 // | 30 // |
31 // NOTE: It is recommended to explicitly call Stop and check its return value. | 31 // NOTE: It is recommended to explicitly call Stop and check its return value. |
32 // If Stop fails, the server is most likely still running and future attempts | 32 // If Stop fails, the server is most likely still running and future attempts |
33 // to bind to the same port will fail, possibly resulting in further test | 33 // to bind to the same port will fail, possibly resulting in further test |
34 // failures. | 34 // failures. |
35 bool Stop() WARN_UNUSED_RESULT; | 35 bool Stop() WARN_UNUSED_RESULT; |
36 | 36 |
| 37 int port() const { return port_; } |
| 38 |
37 private: | 39 private: |
38 FilePath root_directory_; // Root directory of the server. | 40 FilePath root_directory_; // Root directory of the server. |
39 | 41 |
40 int port_; // Port on which the server should listen. | 42 int port_; // Port on which the server should listen. |
41 | 43 |
42 bool running_; // True if the server is currently running. | 44 bool running_; // True if the server is currently running. |
43 | 45 |
44 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
45 // JobObject used to clean up orphaned child processes. | 47 // JobObject used to clean up orphaned child processes. |
46 base::win::ScopedHandle job_handle_; | 48 base::win::ScopedHandle job_handle_; |
47 #endif | 49 #endif |
48 | 50 |
49 DISALLOW_COPY_AND_ASSIGN(LayoutTestHttpServer); | 51 DISALLOW_COPY_AND_ASSIGN(LayoutTestHttpServer); |
50 }; | 52 }; |
51 | 53 |
52 #endif // CHROME_TEST_BASE_LAYOUT_TEST_HTTP_SERVER_H_ | 54 #endif // CHROME_TEST_BASE_LAYOUT_TEST_HTTP_SERVER_H_ |
OLD | NEW |