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/callback.h" | 8 #include "base/callback.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
74 virtual void RunTestOnMainThread() = 0; | 74 virtual void RunTestOnMainThread() = 0; |
75 | 75 |
76 // This is invoked from main after browser_init/browser_main have completed. | 76 // This is invoked from main after browser_init/browser_main have completed. |
77 // This prepares for the test by creating a new browser, runs the test | 77 // This prepares for the test by creating a new browser, runs the test |
78 // (RunTestOnMainThread), quits the browsers and returns. | 78 // (RunTestOnMainThread), quits the browsers and returns. |
79 virtual void RunTestOnMainThreadLoop() = 0; | 79 virtual void RunTestOnMainThreadLoop() = 0; |
80 | 80 |
81 // Sets expected browser exit code, in case it's different than 0 (success). | 81 // Sets expected browser exit code, in case it's different than 0 (success). |
82 void set_expected_exit_code(int code) { expected_exit_code_ = code; } | 82 void set_expected_exit_code(int code) { expected_exit_code_ = code; } |
83 | 83 |
84 // Returns the testing server. Guaranteed to be non-NULL. | |
85 // TODO(phajdan.jr): Remove test_server accessor (http://crbug.com/96594). | |
davidben
2015/11/30 20:29:48
Might be worth stapling to this bug too.
| |
86 const net::SpawnedTestServer* test_server() const { | |
87 return spawned_test_server_.get(); | |
88 } | |
89 net::SpawnedTestServer* test_server() { return spawned_test_server_.get(); } | |
90 | |
91 const net::SpawnedTestServer* spawned_test_server() const { | 84 const net::SpawnedTestServer* spawned_test_server() const { |
92 return spawned_test_server_.get(); | 85 return spawned_test_server_.get(); |
93 } | 86 } |
94 net::SpawnedTestServer* spawned_test_server() { | 87 net::SpawnedTestServer* spawned_test_server() { |
95 return spawned_test_server_.get(); | 88 return spawned_test_server_.get(); |
96 } | 89 } |
97 | 90 |
98 // Returns the embedded test server. Guaranteed to be non-NULL. | 91 // Returns the embedded test server. Guaranteed to be non-NULL. |
99 const net::EmbeddedTestServer* embedded_test_server() const { | 92 const net::EmbeddedTestServer* embedded_test_server() const { |
100 return embedded_test_server_.get(); | 93 return embedded_test_server_.get(); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
162 bool set_up_called_; | 155 bool set_up_called_; |
163 | 156 |
164 #if defined(OS_POSIX) | 157 #if defined(OS_POSIX) |
165 bool handle_sigterm_; | 158 bool handle_sigterm_; |
166 #endif | 159 #endif |
167 }; | 160 }; |
168 | 161 |
169 } // namespace content | 162 } // namespace content |
170 | 163 |
171 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ | 164 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ |
OLD | NEW |