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 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ |
6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ | 6 #define CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 #include "net/test/test_server.h" | 10 #include "net/test/test_server.h" |
11 | 11 |
12 class CommandLine; | 12 class CommandLine; |
| 13 |
| 14 namespace base { |
13 class FilePath; | 15 class FilePath; |
| 16 } |
14 | 17 |
15 namespace content { | 18 namespace content { |
16 | 19 |
17 class BrowserTestBase : public testing::Test { | 20 class BrowserTestBase : public testing::Test { |
18 public: | 21 public: |
19 BrowserTestBase(); | 22 BrowserTestBase(); |
20 virtual ~BrowserTestBase(); | 23 virtual ~BrowserTestBase(); |
21 | 24 |
22 // We do this so we can be used in a Task. | 25 // We do this so we can be used in a Task. |
23 void AddRef() {} | 26 void AddRef() {} |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 handle_sigterm_ = false; | 73 handle_sigterm_ = false; |
71 } | 74 } |
72 #endif | 75 #endif |
73 | 76 |
74 // This function is meant only for classes that directly derive from this | 77 // This function is meant only for classes that directly derive from this |
75 // class to construct the test server in their constructor. They might need to | 78 // class to construct the test server in their constructor. They might need to |
76 // call this after setting up the paths. Actual test cases should never call | 79 // call this after setting up the paths. Actual test cases should never call |
77 // this. | 80 // this. |
78 // |test_server_base| is the path, relative to src, to give to the test HTTP | 81 // |test_server_base| is the path, relative to src, to give to the test HTTP |
79 // server. | 82 // server. |
80 void CreateTestServer(const FilePath& test_server_base); | 83 void CreateTestServer(const base::FilePath& test_server_base); |
81 | 84 |
82 private: | 85 private: |
83 void ProxyRunTestOnMainThreadLoop(); | 86 void ProxyRunTestOnMainThreadLoop(); |
84 | 87 |
85 // Testing server, started on demand. | 88 // Testing server, started on demand. |
86 scoped_ptr<net::TestServer> test_server_; | 89 scoped_ptr<net::TestServer> test_server_; |
87 | 90 |
88 #if defined(OS_POSIX) | 91 #if defined(OS_POSIX) |
89 bool handle_sigterm_; | 92 bool handle_sigterm_; |
90 #endif | 93 #endif |
91 }; | 94 }; |
92 | 95 |
93 } // namespace content | 96 } // namespace content |
94 | 97 |
95 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ | 98 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ |
OLD | NEW |