OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_UI_COCOA_PROFILE_TEST_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ |
6 #define CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ | 6 #define CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 virtual void SetUp() OVERRIDE; | 40 virtual void SetUp() OVERRIDE; |
41 | 41 |
42 virtual void TearDown() OVERRIDE; | 42 virtual void TearDown() OVERRIDE; |
43 | 43 |
44 TestingProfileManager* testing_profile_manager() { | 44 TestingProfileManager* testing_profile_manager() { |
45 return &profile_manager_; | 45 return &profile_manager_; |
46 } | 46 } |
47 TestingProfile* profile() { return profile_; } | 47 TestingProfile* profile() { return profile_; } |
48 Browser* browser() { return browser_.get(); } | 48 Browser* browser() { return browser_.get(); } |
49 | 49 |
50 // Creates the browser window. To close this window call |CloseBrowserWindow|. | 50 // Closes the window for this browser. This will automatically be called as |
51 // Do NOT call close directly on the window. | 51 // part of TearDown() if it's not been done already. |
52 BrowserWindow* CreateBrowserWindow(); | 52 void CloseBrowserWindow(); |
53 | 53 |
54 // Closes the window for this browser. This must only be called after | 54 protected: |
55 // CreateBrowserWindow(). This will automatically be called as part of | 55 // Overridden by test subclasses to create their own browser, e.g. with a |
56 // TearDown() if it's not been done already. | 56 // test window. |
57 void CloseBrowserWindow(); | 57 virtual Browser* CreateBrowser(); |
58 | 58 |
59 private: | 59 private: |
60 MessageLoopForUI message_loop_; | 60 MessageLoopForUI message_loop_; |
61 content::TestBrowserThread ui_thread_; | 61 content::TestBrowserThread ui_thread_; |
62 | 62 |
63 TestingProfileManager profile_manager_; | 63 TestingProfileManager profile_manager_; |
64 TestingProfile* profile_; // Weak; owned by profile_manager_. | 64 TestingProfile* profile_; // Weak; owned by profile_manager_. |
65 scoped_ptr<Browser> browser_; | 65 scoped_ptr<Browser> browser_; |
66 | 66 |
67 scoped_ptr<content::TestBrowserThread> file_user_blocking_thread_; | 67 scoped_ptr<content::TestBrowserThread> file_user_blocking_thread_; |
68 scoped_ptr<content::TestBrowserThread> file_thread_; | 68 scoped_ptr<content::TestBrowserThread> file_thread_; |
69 scoped_ptr<content::TestBrowserThread> io_thread_; | 69 scoped_ptr<content::TestBrowserThread> io_thread_; |
70 }; | 70 }; |
71 | 71 |
72 #endif // CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ | 72 #endif // CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ |
OLD | NEW |