Chromium Code Reviews| 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/at_exit.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 namespace test { | 33 namespace test { |
| 34 class AshTestEnvironment; | 34 class AshTestEnvironment; |
| 35 class AshTestHelper; | 35 class AshTestHelper; |
| 36 } | 36 } |
| 37 } | 37 } |
| 38 #elif defined(TOOLKIT_VIEWS) | 38 #elif defined(TOOLKIT_VIEWS) |
| 39 namespace views { | 39 namespace views { |
| 40 class ScopedViewsTestHelper; | 40 class ScopedViewsTestHelper; |
| 41 } | 41 } |
| 42 #endif | 42 #endif |
| 43 namespace views { | |
| 44 class TestViewsDelegate; | |
| 45 } | |
| 43 | 46 |
| 44 namespace content { | 47 namespace content { |
| 45 class NavigationController; | 48 class NavigationController; |
| 46 } | 49 } |
| 47 | 50 |
| 48 // Base class for browser based unit tests. BrowserWithTestWindowTest creates a | 51 // Base class for browser based unit tests. BrowserWithTestWindowTest creates a |
| 49 // Browser with a TestingProfile and TestBrowserWindow. To add a tab use | 52 // Browser with a TestingProfile and TestBrowserWindow. To add a tab use |
| 50 // AddTab. For example, the following adds a tab and navigates to | 53 // AddTab. For example, the following adds a tab and navigates to |
| 51 // two URLs that target the TestWebContents: | 54 // two URLs that target the TestWebContents: |
| 52 // | 55 // |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 141 // value. Can return NULL to use the default window created by Browser. | 144 // value. Can return NULL to use the default window created by Browser. |
| 142 virtual BrowserWindow* CreateBrowserWindow(); | 145 virtual BrowserWindow* CreateBrowserWindow(); |
| 143 | 146 |
| 144 // Creates the browser given |profile|, |browser_type|, |hosted_app|, and | 147 // Creates the browser given |profile|, |browser_type|, |hosted_app|, and |
| 145 // |browser_window|. The caller owns the return value. | 148 // |browser_window|. The caller owns the return value. |
| 146 virtual Browser* CreateBrowser(Profile* profile, | 149 virtual Browser* CreateBrowser(Profile* profile, |
| 147 Browser::Type browser_type, | 150 Browser::Type browser_type, |
| 148 bool hosted_app, | 151 bool hosted_app, |
| 149 BrowserWindow* browser_window); | 152 BrowserWindow* browser_window); |
| 150 | 153 |
| 154 views::TestViewsDelegate* views_delegate(); | |
|
Peter Kasting
2017/04/04 02:08:55
Nit: This should be defined here or else named Cam
kylix_rd
2017/04/04 20:28:23
Renamed to test_views_delegate().
Peter Kasting
2017/04/05 19:30:10
That addresses the second concern I had, but not t
kylix_rd
2017/04/06 16:48:19
Hmmm. I was looking more for consistency with the
Peter Kasting
2017/04/06 20:05:33
That's fine, just inline it then :)
The actual fu
kylix_rd
2017/04/07 14:07:59
I'll need to verify that including test_views_dele
kylix_rd
2017/04/07 18:33:36
Done.
| |
| 155 | |
| 151 private: | 156 private: |
| 152 // We need to create a MessageLoop, otherwise a bunch of things fails. | 157 // We need to create a MessageLoop, otherwise a bunch of things fails. |
| 153 content::TestBrowserThreadBundle thread_bundle_; | 158 content::TestBrowserThreadBundle thread_bundle_; |
| 154 base::ShadowingAtExitManager at_exit_manager_; | 159 base::ShadowingAtExitManager at_exit_manager_; |
| 155 | 160 |
| 156 #if defined(OS_CHROMEOS) | 161 #if defined(OS_CHROMEOS) |
| 157 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; | 162 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; |
| 158 chromeos::ScopedTestCrosSettings test_cros_settings_; | 163 chromeos::ScopedTestCrosSettings test_cros_settings_; |
| 159 chromeos::ScopedTestUserManager test_user_manager_; | 164 chromeos::ScopedTestUserManager test_user_manager_; |
| 160 #endif | 165 #endif |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 184 // The type of browser to create (tabbed or popup). | 189 // The type of browser to create (tabbed or popup). |
| 185 Browser::Type browser_type_; | 190 Browser::Type browser_type_; |
| 186 | 191 |
| 187 // Whether the browser is part of a hosted app. | 192 // Whether the browser is part of a hosted app. |
| 188 bool hosted_app_; | 193 bool hosted_app_; |
| 189 | 194 |
| 190 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest); | 195 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest); |
| 191 }; | 196 }; |
| 192 | 197 |
| 193 #endif // CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ | 198 #endif // CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ |
| OLD | NEW |