OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ | 5 #ifndef CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ |
6 #define CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ | 6 #define CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ |
7 | 7 |
| 8 #include "base/at_exit.h" |
8 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
9 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/test/base/test_browser_window.h" | 11 #include "chrome/test/base/test_browser_window.h" |
11 #include "chrome/test/base/testing_profile.h" | 12 #include "chrome/test/base/testing_profile.h" |
12 #include "content/public/test/test_browser_thread.h" | 13 #include "content/public/test/test_browser_thread.h" |
13 #include "content/public/test/test_renderer_host.h" | 14 #include "content/public/test/test_renderer_host.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
15 | 16 |
16 #if defined(OS_WIN) | 17 #if defined(OS_WIN) |
17 #include "ui/base/win/scoped_ole_initializer.h" | 18 #include "ui/base/win/scoped_ole_initializer.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // Destroys the browser, window, and profile created by this class. This is | 101 // Destroys the browser, window, and profile created by this class. This is |
101 // invoked from the destructor. | 102 // invoked from the destructor. |
102 void DestroyBrowserAndProfile(); | 103 void DestroyBrowserAndProfile(); |
103 | 104 |
104 // Creates the profile used by this test. The caller owns the return value. | 105 // Creates the profile used by this test. The caller owns the return value. |
105 virtual TestingProfile* CreateProfile(); | 106 virtual TestingProfile* CreateProfile(); |
106 | 107 |
107 private: | 108 private: |
108 // We need to create a MessageLoop, otherwise a bunch of things fails. | 109 // We need to create a MessageLoop, otherwise a bunch of things fails. |
109 MessageLoopForUI ui_loop_; | 110 MessageLoopForUI ui_loop_; |
| 111 base::ShadowingAtExitManager at_exit_manager_; |
110 content::TestBrowserThread ui_thread_; | 112 content::TestBrowserThread ui_thread_; |
111 content::TestBrowserThread db_thread_; | 113 content::TestBrowserThread db_thread_; |
112 content::TestBrowserThread file_thread_; | 114 content::TestBrowserThread file_thread_; |
113 content::TestBrowserThread file_user_blocking_thread_; | 115 content::TestBrowserThread file_user_blocking_thread_; |
114 | 116 |
115 scoped_ptr<TestingProfile> profile_; | 117 scoped_ptr<TestingProfile> profile_; |
116 scoped_ptr<TestBrowserWindow> window_; | 118 scoped_ptr<TestBrowserWindow> window_; |
117 scoped_ptr<Browser> browser_; | 119 scoped_ptr<Browser> browser_; |
118 | 120 |
119 // The existence of this object enables tests via | 121 // The existence of this object enables tests via |
120 // RenderViewHostTester. | 122 // RenderViewHostTester. |
121 content::RenderViewHostTestEnabler rvh_test_enabler_; | 123 content::RenderViewHostTestEnabler rvh_test_enabler_; |
122 | 124 |
123 #if defined(USE_AURA) | 125 #if defined(USE_AURA) |
124 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; | 126 scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; |
125 #endif | 127 #endif |
126 | 128 |
127 #if defined(OS_WIN) | 129 #if defined(OS_WIN) |
128 ui::ScopedOleInitializer ole_initializer_; | 130 ui::ScopedOleInitializer ole_initializer_; |
129 #endif | 131 #endif |
130 | 132 |
131 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest); | 133 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest); |
132 }; | 134 }; |
133 | 135 |
134 #endif // CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ | 136 #endif // CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ |
OLD | NEW |