Chromium Code Reviews| 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/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 // BrowserMain. BrowserMain ends up invoking RunTestOnMainThreadLoop. | 104 // BrowserMain. BrowserMain ends up invoking RunTestOnMainThreadLoop. |
| 105 void SetUp() override; | 105 void SetUp() override; |
| 106 | 106 |
| 107 // Restores state configured in SetUp. | 107 // Restores state configured in SetUp. |
| 108 void TearDown() override; | 108 void TearDown() override; |
| 109 | 109 |
| 110 protected: | 110 protected: |
| 111 // Returns the browser created by CreateBrowser. | 111 // Returns the browser created by CreateBrowser. |
| 112 Browser* browser() const { return browser_; } | 112 Browser* browser() const { return browser_; } |
| 113 | 113 |
| 114 // Closes the given browser and waits for it to release all its resources. | |
| 115 void CloseBrowserSynchronously(Browser* browser); | |
| 116 | |
| 117 // Closes the browser without waiting for it to release all its resources. | |
| 118 // WARNING: This may leave tasks posted, but not yet run, in the message | |
| 119 // loops. Prefer CloseBrowserSynchronously over this method. | |
| 120 void CloseBrowserWithoutWaiting(Browser* browser); | |
|
Robert Sesek
2015/07/09 15:07:05
Why "WithoutWaiting" instead of "Asynchronously" ?
erikchen
2015/07/09 23:35:43
I plead the fifth. Changed the name to CloseBrowse
| |
| 121 | |
| 122 // Closes all browsers. No guarantees are made about the destruction of | |
| 123 // outstanding resources. | |
| 124 void CloseAllBrowsers(); | |
| 125 | |
| 114 // Convenience methods for adding tabs to a Browser. | 126 // Convenience methods for adding tabs to a Browser. |
| 115 void AddTabAtIndexToBrowser(Browser* browser, | 127 void AddTabAtIndexToBrowser(Browser* browser, |
| 116 int index, | 128 int index, |
| 117 const GURL& url, | 129 const GURL& url, |
| 118 ui::PageTransition transition, | 130 ui::PageTransition transition, |
| 119 bool check_navigation_success); | 131 bool check_navigation_success); |
| 120 void AddTabAtIndex(int index, | 132 void AddTabAtIndex(int index, |
| 121 const GURL& url, | 133 const GURL& url, |
| 122 ui::PageTransition transition); | 134 ui::PageTransition transition); |
| 123 | 135 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 229 base::mac::ScopedNSAutoreleasePool* autorelease_pool_; | 241 base::mac::ScopedNSAutoreleasePool* autorelease_pool_; |
| 230 scoped_ptr<ScopedBundleSwizzlerMac> bundle_swizzler_; | 242 scoped_ptr<ScopedBundleSwizzlerMac> bundle_swizzler_; |
| 231 #endif // OS_MACOSX | 243 #endif // OS_MACOSX |
| 232 | 244 |
| 233 #if defined(OS_WIN) | 245 #if defined(OS_WIN) |
| 234 scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_; | 246 scoped_ptr<base::win::ScopedCOMInitializer> com_initializer_; |
| 235 #endif | 247 #endif |
| 236 }; | 248 }; |
| 237 | 249 |
| 238 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ | 250 #endif // CHROME_TEST_BASE_IN_PROCESS_BROWSER_TEST_H_ |
| OLD | NEW |