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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // Configures everything for an in process browser test, then invokes | 101 // Configures everything for an in process browser test, then invokes |
102 // BrowserMain. BrowserMain ends up invoking RunTestOnMainThreadLoop. | 102 // BrowserMain. BrowserMain ends up invoking RunTestOnMainThreadLoop. |
103 virtual void SetUp() OVERRIDE; | 103 virtual void SetUp() OVERRIDE; |
104 | 104 |
105 // Restores state configured in SetUp. | 105 // Restores state configured in SetUp. |
106 virtual void TearDown() OVERRIDE; | 106 virtual void TearDown() OVERRIDE; |
107 | 107 |
108 protected: | 108 protected: |
109 // Returns the browser created by CreateBrowser. | 109 // Returns the browser created by CreateBrowser. |
110 Browser* browser() const { return browser_; } | 110 Browser* browser() const { return browser_; } |
| 111 void set_browser(Browser* b) { browser_ = b; } |
111 | 112 |
112 // Returns the Resource/BrowserContext from browser_. Needed because tests in | 113 // Returns the Resource/BrowserContext from browser_. Needed because tests in |
113 // content don't have access to Profile. | 114 // content don't have access to Profile. |
114 content::BrowserContext* GetBrowserContext(); | 115 content::BrowserContext* GetBrowserContext(); |
115 content::ResourceContext* GetResourceContext(); | 116 content::ResourceContext* GetResourceContext(); |
116 | 117 |
117 // Convenience methods for adding tabs to a Browser. | 118 // Convenience methods for adding tabs to a Browser. |
118 void AddTabAtIndexToBrowser(Browser* browser, | 119 void AddTabAtIndexToBrowser(Browser* browser, |
119 int index, | 120 int index, |
120 const GURL& url, | 121 const GURL& url, |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 #if defined(OS_CHROMEOS) | 209 #if defined(OS_CHROMEOS) |
209 chromeos::ScopedStubCrosEnabler stub_cros_enabler_; | 210 chromeos::ScopedStubCrosEnabler stub_cros_enabler_; |
210 #endif // defined(OS_CHROMEOS) | 211 #endif // defined(OS_CHROMEOS) |
211 | 212 |
212 #if defined(OS_MACOSX) | 213 #if defined(OS_MACOSX) |
213 base::mac::ScopedNSAutoreleasePool* autorelease_pool_; | 214 base::mac::ScopedNSAutoreleasePool* autorelease_pool_; |
214 #endif // OS_MACOSX | 215 #endif // OS_MACOSX |
215 }; | 216 }; |
216 | 217 |
217 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ | 218 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ |
OLD | NEW |