diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-18 01:50:06 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-18 01:50:06 +0000 |
commit | c445959a53eee3eec0a4b71ca7c50c8b89b9bfdc (patch) | |
tree | 05acb93f07aa3f5a59489aaf199d1979fe4ec67f /chrome/browser/cocoa/browser_test_helper.h | |
parent | 726166cb840757a10eda3fe31210176b950e6521 (diff) | |
download | chromium_src-c445959a53eee3eec0a4b71ca7c50c8b89b9bfdc.zip chromium_src-c445959a53eee3eec0a4b71ca7c50c8b89b9bfdc.tar.gz chromium_src-c445959a53eee3eec0a4b71ca7c50c8b89b9bfdc.tar.bz2 |
Fixes up TabStripControllerTests so that they work with CocoaTest.
Enhances BrowserTestHelper so that you can create and close the
browser window.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/402035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32253 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/browser_test_helper.h')
-rw-r--r-- | chrome/browser/cocoa/browser_test_helper.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/browser_test_helper.h b/chrome/browser/cocoa/browser_test_helper.h index 772a1bb..1b63780 100644 --- a/chrome/browser/cocoa/browser_test_helper.h +++ b/chrome/browser/cocoa/browser_test_helper.h @@ -31,6 +31,22 @@ class BrowserTestHelper { TestingProfile* profile() const { return profile_.get(); } Browser* browser() const { return browser_.get(); } + // Creates the browser window. To close this window call |CloseBrowserWindow|. + // Do NOT call close directly on the window. + BrowserWindow* CreateBrowserWindow() { + browser_->CreateBrowserWindow(); + return browser_->window(); + } + + // Closes the window for this browser. + void CloseBrowserWindow() { + // Check to make sure a window was actually created. + DCHECK(browser_->window()); + browser_->CloseAllTabs(); + browser_->CloseWindow(); + browser_.release(); + } + private: scoped_ptr<TestingProfile> profile_; scoped_ptr<Browser> browser_; |