Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: chrome/test/base/browser_with_test_window_test.h

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Changes due to feedback. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 10 matching lines...) Expand all
21 #include "chrome/browser/chromeos/settings/cros_settings.h" 21 #include "chrome/browser/chromeos/settings/cros_settings.h"
22 #include "chrome/browser/chromeos/settings/device_settings_service.h" 22 #include "chrome/browser/chromeos/settings/device_settings_service.h"
23 #endif 23 #endif
24 24
25 #if defined(OS_WIN) 25 #if defined(OS_WIN)
26 #include "ui/base/win/scoped_ole_initializer.h" 26 #include "ui/base/win/scoped_ole_initializer.h"
27 #endif 27 #endif
28 28
29 class GURL; 29 class GURL;
30 30
31 #if defined(TOOLKIT_VIEWS)
32
31 #if defined(OS_CHROMEOS) 33 #if defined(OS_CHROMEOS)
32 namespace ash { 34 namespace ash {
33 namespace test { 35 namespace test {
34 class AshTestEnvironment; 36 class AshTestEnvironment;
35 class AshTestHelper; 37 class AshTestHelper;
36 } 38 }
37 } 39 }
38 #elif defined(TOOLKIT_VIEWS) 40 #else
39 namespace views { 41 namespace views {
40 class ScopedViewsTestHelper; 42 class ScopedViewsTestHelper;
41 } 43 }
42 #endif 44 #endif
43 45
46 namespace views {
47 class TestViewsDelegate;
48 }
49 #endif
50
44 namespace content { 51 namespace content {
45 class NavigationController; 52 class NavigationController;
46 } 53 }
47 54
48 // Base class for browser based unit tests. BrowserWithTestWindowTest creates a 55 // Base class for browser based unit tests. BrowserWithTestWindowTest creates a
49 // Browser with a TestingProfile and TestBrowserWindow. To add a tab use 56 // Browser with a TestingProfile and TestBrowserWindow. To add a tab use
50 // AddTab. For example, the following adds a tab and navigates to 57 // AddTab. For example, the following adds a tab and navigates to
51 // two URLs that target the TestWebContents: 58 // two URLs that target the TestWebContents:
52 // 59 //
53 // // Add a new tab and navigate it. This will be at index 0. 60 // // Add a new tab and navigate it. This will be at index 0.
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // value. Can return NULL to use the default window created by Browser. 148 // value. Can return NULL to use the default window created by Browser.
142 virtual BrowserWindow* CreateBrowserWindow(); 149 virtual BrowserWindow* CreateBrowserWindow();
143 150
144 // Creates the browser given |profile|, |browser_type|, |hosted_app|, and 151 // Creates the browser given |profile|, |browser_type|, |hosted_app|, and
145 // |browser_window|. The caller owns the return value. 152 // |browser_window|. The caller owns the return value.
146 virtual Browser* CreateBrowser(Profile* profile, 153 virtual Browser* CreateBrowser(Profile* profile,
147 Browser::Type browser_type, 154 Browser::Type browser_type,
148 bool hosted_app, 155 bool hosted_app,
149 BrowserWindow* browser_window); 156 BrowserWindow* browser_window);
150 157
158 #if defined(TOOLKIT_VIEWS)
159 views::TestViewsDelegate* test_views_delegate();
160 #endif
161
151 private: 162 private:
152 // We need to create a MessageLoop, otherwise a bunch of things fails. 163 // We need to create a MessageLoop, otherwise a bunch of things fails.
153 content::TestBrowserThreadBundle thread_bundle_; 164 content::TestBrowserThreadBundle thread_bundle_;
154 base::ShadowingAtExitManager at_exit_manager_; 165 base::ShadowingAtExitManager at_exit_manager_;
155 166
156 #if defined(OS_CHROMEOS) 167 #if defined(OS_CHROMEOS)
157 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; 168 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_;
158 chromeos::ScopedTestCrosSettings test_cros_settings_; 169 chromeos::ScopedTestCrosSettings test_cros_settings_;
159 chromeos::ScopedTestUserManager test_user_manager_; 170 chromeos::ScopedTestUserManager test_user_manager_;
160 #endif 171 #endif
(...skipping 23 matching lines...) Expand all
184 // The type of browser to create (tabbed or popup). 195 // The type of browser to create (tabbed or popup).
185 Browser::Type browser_type_; 196 Browser::Type browser_type_;
186 197
187 // Whether the browser is part of a hosted app. 198 // Whether the browser is part of a hosted app.
188 bool hosted_app_; 199 bool hosted_app_;
189 200
190 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest); 201 DISALLOW_COPY_AND_ASSIGN(BrowserWithTestWindowTest);
191 }; 202 };
192 203
193 #endif // CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_ 204 #endif // CHROME_TEST_BASE_BROWSER_WITH_TEST_WINDOW_TEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698