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 CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ | 5 #ifndef CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ |
6 #define CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ | 6 #define CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 content::ResourceContext* GetResourceContext(); | 103 content::ResourceContext* GetResourceContext(); |
104 | 104 |
105 // Convenience methods for adding tabs to a Browser. | 105 // Convenience methods for adding tabs to a Browser. |
106 void AddTabAtIndexToBrowser(Browser* browser, | 106 void AddTabAtIndexToBrowser(Browser* browser, |
107 int index, | 107 int index, |
108 const GURL& url, | 108 const GURL& url, |
109 content::PageTransition transition); | 109 content::PageTransition transition); |
110 void AddTabAtIndex(int index, const GURL& url, | 110 void AddTabAtIndex(int index, const GURL& url, |
111 content::PageTransition transition); | 111 content::PageTransition transition); |
112 | 112 |
113 // Override this to add any custom setup code that needs to be done on the | |
114 // main thread after the browser is created and just before calling | |
115 // RunTestOnMainThread(). | |
116 virtual void SetUpOnMainThread() {} | |
117 | |
118 // Initializes the contents of the user data directory. Called by SetUp() | 113 // Initializes the contents of the user data directory. Called by SetUp() |
119 // after creating the user data directory, but before any browser is launched. | 114 // after creating the user data directory, but before any browser is launched. |
120 // If a test wishes to set up some initial non-empty state in the user data | 115 // If a test wishes to set up some initial non-empty state in the user data |
121 // directory before the browser starts up, it can do so here. Returns true if | 116 // directory before the browser starts up, it can do so here. Returns true if |
122 // successful. | 117 // successful. |
123 virtual bool SetUpUserDataDirectory() WARN_UNUSED_RESULT; | 118 virtual bool SetUpUserDataDirectory() WARN_UNUSED_RESULT; |
124 | 119 |
125 // Override this to add command line flags specific to your test. | |
126 virtual void SetUpCommandLine(CommandLine* command_line) {} | |
127 | |
128 // Override this to add any custom cleanup code that needs to be done on the | 120 // Override this to add any custom cleanup code that needs to be done on the |
129 // main thread before the browser is torn down. | 121 // main thread before the browser is torn down. |
130 virtual void CleanUpOnMainThread() {} | 122 virtual void CleanUpOnMainThread() {} |
131 | 123 |
132 // BrowserTestBase: | 124 // BrowserTestBase: |
133 virtual void RunTestOnMainThreadLoop() OVERRIDE; | 125 virtual void RunTestOnMainThreadLoop() OVERRIDE; |
134 | 126 |
135 // Returns the testing server. Guaranteed to be non-NULL. | 127 // Returns the testing server. Guaranteed to be non-NULL. |
136 const net::TestServer* test_server() const { return test_server_.get(); } | 128 const net::TestServer* test_server() const { return test_server_.get(); } |
137 net::TestServer* test_server() { return test_server_.get(); } | 129 net::TestServer* test_server() { return test_server_.get(); } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 #if defined(OS_CHROMEOS) | 215 #if defined(OS_CHROMEOS) |
224 chromeos::ScopedStubCrosEnabler stub_cros_enabler_; | 216 chromeos::ScopedStubCrosEnabler stub_cros_enabler_; |
225 #endif // defined(OS_CHROMEOS) | 217 #endif // defined(OS_CHROMEOS) |
226 | 218 |
227 #if defined(OS_MACOSX) | 219 #if defined(OS_MACOSX) |
228 base::mac::ScopedNSAutoreleasePool* autorelease_pool_; | 220 base::mac::ScopedNSAutoreleasePool* autorelease_pool_; |
229 #endif // OS_MACOSX | 221 #endif // OS_MACOSX |
230 }; | 222 }; |
231 | 223 |
232 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ | 224 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ |
OLD | NEW |