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 "net/test/spawned_test_server/spawned_test_server.h" | 10 #include "net/test/spawned_test_server/spawned_test_server.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 virtual void SetUp() OVERRIDE; | 38 virtual void SetUp() OVERRIDE; |
39 | 39 |
40 // Restores state configured in SetUp. | 40 // Restores state configured in SetUp. |
41 virtual void TearDown() OVERRIDE; | 41 virtual void TearDown() OVERRIDE; |
42 | 42 |
43 // Override this to add any custom setup code that needs to be done on the | 43 // Override this to add any custom setup code that needs to be done on the |
44 // main thread after the browser is created and just before calling | 44 // main thread after the browser is created and just before calling |
45 // RunTestOnMainThread(). | 45 // RunTestOnMainThread(). |
46 virtual void SetUpOnMainThread() {} | 46 virtual void SetUpOnMainThread() {} |
47 | 47 |
| 48 // Override this to add any custom teardown code that needs to be done on the |
| 49 // main thread right after RunTestOnMainThread(). |
| 50 virtual void TearDownOnMainThread() {} |
| 51 |
48 // Override this to add command line flags specific to your test. | 52 // Override this to add command line flags specific to your test. |
49 virtual void SetUpCommandLine(CommandLine* command_line) {} | 53 virtual void SetUpCommandLine(CommandLine* command_line) {} |
50 | 54 |
51 protected: | 55 protected: |
52 // We need these special methods because SetUp is the bottom of the stack | 56 // We need these special methods because SetUp is the bottom of the stack |
53 // that winds up calling your test method, so it is not always an option | 57 // that winds up calling your test method, so it is not always an option |
54 // to do what you want by overriding it and calling the superclass version. | 58 // to do what you want by overriding it and calling the superclass version. |
55 // | 59 // |
56 // Override this for things you would normally override SetUp for. It will be | 60 // Override this for things you would normally override SetUp for. It will be |
57 // called before your individual test fixture method is run, but after most | 61 // called before your individual test fixture method is run, but after most |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_; | 119 scoped_ptr<net::test_server::EmbeddedTestServer> embedded_test_server_; |
116 | 120 |
117 #if defined(OS_POSIX) | 121 #if defined(OS_POSIX) |
118 bool handle_sigterm_; | 122 bool handle_sigterm_; |
119 #endif | 123 #endif |
120 }; | 124 }; |
121 | 125 |
122 } // namespace content | 126 } // namespace content |
123 | 127 |
124 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ | 128 #endif // CONTENT_PUBLIC_TEST_BROWSER_TEST_BASE_H_ |
OLD | NEW |