Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2800)

Unified Diff: chrome/browser/ui/cocoa/browser_test_helper.h

Issue 6546073: More OOLing on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Yeap Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/accelerators_cocoa.mm ('k') | chrome/browser/ui/cocoa/browser_test_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/browser_test_helper.h
diff --git a/chrome/browser/ui/cocoa/browser_test_helper.h b/chrome/browser/ui/cocoa/browser_test_helper.h
index af22364e68ffec41075dc913f870d0cf42ea812f..e03b584354b25609df8feea781f821588d8ce7af 100644
--- a/chrome/browser/ui/cocoa/browser_test_helper.h
+++ b/chrome/browser/ui/cocoa/browser_test_helper.h
@@ -26,58 +26,19 @@
// navigation_controller_unittest.cc, ..
class BrowserTestHelper {
public:
- BrowserTestHelper()
- : ui_thread_(BrowserThread::UI, &message_loop_),
- file_thread_(new BrowserThread(BrowserThread::FILE, &message_loop_)),
- io_thread_(new BrowserThread(BrowserThread::IO, &message_loop_)) {
- profile_.reset(new TestingProfile());
- profile_->CreateBookmarkModel(true);
- profile_->BlockUntilBookmarkModelLoaded();
+ BrowserTestHelper();
+ virtual ~BrowserTestHelper();
- // TODO(shess): These are needed in case someone creates a browser
- // window off of browser_. pkasting indicates that other
- // platforms use a stub |BrowserWindow| and thus don't need to do
- // this.
- // http://crbug.com/39725
- profile_->CreateAutocompleteClassifier();
- profile_->CreateTemplateURLModel();
-
- browser_.reset(new Browser(Browser::TYPE_NORMAL, profile_.get()));
- }
-
- virtual ~BrowserTestHelper() {
- // Delete the testing profile on the UI thread. But first release the
- // browser, since it may trigger accesses to the profile upon destruction.
- browser_.reset();
-
- // Drop any new tasks for the IO and FILE threads.
- io_thread_.reset();
- file_thread_.reset();
-
- message_loop_.DeleteSoon(FROM_HERE, profile_.release());
- message_loop_.RunAllPending();
- }
-
- virtual TestingProfile* profile() const { return profile_.get(); }
+ virtual TestingProfile* profile() const;
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();
- }
+ BrowserWindow* CreateBrowserWindow();
// Closes the window for this browser. This must only be called after
// CreateBrowserWindow().
- void CloseBrowserWindow() {
- // Check to make sure a window was actually created.
- DCHECK(browser_->window());
- browser_->CloseAllTabs();
- browser_->CloseWindow();
- // |browser_| will be deleted by its BrowserWindowController.
- ignore_result(browser_.release());
- }
+ void CloseBrowserWindow();
private:
scoped_ptr<TestingProfile> profile_;
« no previous file with comments | « chrome/browser/ui/cocoa/accelerators_cocoa.mm ('k') | chrome/browser/ui/cocoa/browser_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698