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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 // navigation_controller_unittest.cc, .. | 30 // navigation_controller_unittest.cc, .. |
31 class CocoaProfileTest : public CocoaTest { | 31 class CocoaProfileTest : public CocoaTest { |
32 public: | 32 public: |
33 CocoaProfileTest(); | 33 CocoaProfileTest(); |
34 virtual ~CocoaProfileTest(); | 34 virtual ~CocoaProfileTest(); |
35 | 35 |
36 // This constructs a a Browser and a TestingProfile. It is guaranteed to | 36 // This constructs a a Browser and a TestingProfile. It is guaranteed to |
37 // succeed, else it will ASSERT and cause the test to fail. Subclasses that | 37 // succeed, else it will ASSERT and cause the test to fail. Subclasses that |
38 // do work in SetUp should ASSERT that either browser() or profile() are | 38 // do work in SetUp should ASSERT that either browser() or profile() are |
39 // non-NULL before proceeding after the call to super (this). | 39 // non-NULL before proceeding after the call to super (this). |
40 virtual void SetUp(); | 40 virtual void SetUp() OVERRIDE; |
41 | 41 |
42 virtual void TearDown(); | 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 // Creates the browser window. To close this window call |CloseBrowserWindow|. |
51 // Do NOT call close directly on the window. | 51 // Do NOT call close directly on the window. |
52 BrowserWindow* CreateBrowserWindow(); | 52 BrowserWindow* CreateBrowserWindow(); |
53 | 53 |
54 // Closes the window for this browser. This must only be called after | 54 // Closes the window for this browser. This must only be called after |
55 // CreateBrowserWindow(). This will automatically be called as part of | 55 // CreateBrowserWindow(). This will automatically be called as part of |
56 // TearDown() if it's not been done already. | 56 // TearDown() if it's not been done already. |
57 void CloseBrowserWindow(); | 57 void CloseBrowserWindow(); |
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_thread_; | 67 scoped_ptr<content::TestBrowserThread> file_thread_; |
68 scoped_ptr<content::TestBrowserThread> io_thread_; | 68 scoped_ptr<content::TestBrowserThread> io_thread_; |
69 }; | 69 }; |
70 | 70 |
71 #endif // CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ | 71 #endif // CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ |
OLD | NEW |