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 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" | 9 #import "chrome/browser/ui/cocoa/cocoa_test_helper.h" |
10 #include "chrome/test/base/testing_profile_manager.h" | 10 #include "chrome/test/base/testing_profile_manager.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 // navigation_controller_unittest.cc, .. | 32 // navigation_controller_unittest.cc, .. |
33 class CocoaProfileTest : public CocoaTest { | 33 class CocoaProfileTest : public CocoaTest { |
34 public: | 34 public: |
35 CocoaProfileTest(); | 35 CocoaProfileTest(); |
36 virtual ~CocoaProfileTest(); | 36 virtual ~CocoaProfileTest(); |
37 | 37 |
38 // This constructs a a Browser and a TestingProfile. It is guaranteed to | 38 // This constructs a a Browser and a TestingProfile. It is guaranteed to |
39 // succeed, else it will ASSERT and cause the test to fail. Subclasses that | 39 // succeed, else it will ASSERT and cause the test to fail. Subclasses that |
40 // do work in SetUp should ASSERT that either browser() or profile() are | 40 // do work in SetUp should ASSERT that either browser() or profile() are |
41 // non-NULL before proceeding after the call to super (this). | 41 // non-NULL before proceeding after the call to super (this). |
42 virtual void SetUp() OVERRIDE; | 42 virtual void SetUp() override; |
43 | 43 |
44 virtual void TearDown() OVERRIDE; | 44 virtual void TearDown() override; |
45 | 45 |
46 TestingProfileManager* testing_profile_manager() { | 46 TestingProfileManager* testing_profile_manager() { |
47 return &profile_manager_; | 47 return &profile_manager_; |
48 } | 48 } |
49 TestingProfile* profile() { return profile_; } | 49 TestingProfile* profile() { return profile_; } |
50 Browser* browser() { return browser_.get(); } | 50 Browser* browser() { return browser_.get(); } |
51 | 51 |
52 // Closes the window for this browser. This will automatically be called as | 52 // Closes the window for this browser. This will automatically be called as |
53 // part of TearDown() if it's not been done already. | 53 // part of TearDown() if it's not been done already. |
54 void CloseBrowserWindow(); | 54 void CloseBrowserWindow(); |
55 | 55 |
56 protected: | 56 protected: |
57 // Overridden by test subclasses to create their own browser, e.g. with a | 57 // Overridden by test subclasses to create their own browser, e.g. with a |
58 // test window. | 58 // test window. |
59 virtual Browser* CreateBrowser(); | 59 virtual Browser* CreateBrowser(); |
60 | 60 |
61 private: | 61 private: |
62 TestingProfileManager profile_manager_; | 62 TestingProfileManager profile_manager_; |
63 TestingProfile* profile_; // Weak; owned by profile_manager_. | 63 TestingProfile* profile_; // Weak; owned by profile_manager_. |
64 scoped_ptr<Browser> browser_; | 64 scoped_ptr<Browser> browser_; |
65 | 65 |
66 scoped_ptr<content::TestBrowserThreadBundle> thread_bundle_; | 66 scoped_ptr<content::TestBrowserThreadBundle> thread_bundle_; |
67 }; | 67 }; |
68 | 68 |
69 #endif // CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ | 69 #endif // CHROME_BROWSER_UI_COCOA_PROFILE_TEST_H_ |
OLD | NEW |