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 #include "chrome/test/base/browser_with_test_window_test.h" | 5 #include "chrome/test/base/browser_with_test_window_test.h" |
6 | 6 |
7 #include "ash/common/material_design/material_design_controller.h" | 7 #include "ash/common/material_design/material_design_controller.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
11 #include "base/threading/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
13 #include "chrome/browser/profiles/profile_destroyer.h" | 13 #include "chrome/browser/profiles/profile_destroyer.h" |
14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/browser/ui/browser_navigator.h" | 15 #include "chrome/browser/ui/browser_navigator.h" |
16 #include "chrome/browser/ui/browser_navigator_params.h" | 16 #include "chrome/browser/ui/browser_navigator_params.h" |
17 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 17 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
18 #include "chrome/test/base/testing_profile.h" | 18 #include "chrome/test/base/testing_profile.h" |
19 #include "content/public/browser/navigation_controller.h" | 19 #include "content/public/browser/navigation_controller.h" |
20 #include "content/public/browser/navigation_entry.h" | 20 #include "content/public/browser/navigation_entry.h" |
21 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
22 #include "content/public/test/test_renderer_host.h" | 22 #include "content/public/test/test_renderer_host.h" |
23 #include "ui/base/page_transition_types.h" | 23 #include "ui/base/page_transition_types.h" |
24 | 24 |
25 #if defined(OS_CHROMEOS) | 25 #if defined(OS_CHROMEOS) |
26 #include "ash/test/ash_test_helper.h" | 26 #include "ash/test/ash_test_helper.h" |
27 #include "chrome/test/base/ash_test_environment_chrome.h" | |
28 #elif defined(TOOLKIT_VIEWS) | 27 #elif defined(TOOLKIT_VIEWS) |
29 #include "ui/views/test/scoped_views_test_helper.h" | 28 #include "ui/views/test/scoped_views_test_helper.h" |
30 #endif | 29 #endif |
31 | 30 |
32 #if defined(TOOLKIT_VIEWS) | 31 #if defined(TOOLKIT_VIEWS) |
33 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" | 32 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h" |
34 #include "components/constrained_window/constrained_window_views.h" | 33 #include "components/constrained_window/constrained_window_views.h" |
35 #endif | 34 #endif |
36 | 35 |
37 using content::NavigationController; | 36 using content::NavigationController; |
(...skipping 10 matching lines...) Expand all Loading... |
48 | 47 |
49 BrowserWithTestWindowTest::~BrowserWithTestWindowTest() { | 48 BrowserWithTestWindowTest::~BrowserWithTestWindowTest() { |
50 } | 49 } |
51 | 50 |
52 void BrowserWithTestWindowTest::SetUp() { | 51 void BrowserWithTestWindowTest::SetUp() { |
53 testing::Test::SetUp(); | 52 testing::Test::SetUp(); |
54 #if defined(OS_CHROMEOS) | 53 #if defined(OS_CHROMEOS) |
55 // TODO(jamescook): Windows Ash support. This will require refactoring | 54 // TODO(jamescook): Windows Ash support. This will require refactoring |
56 // AshTestHelper and AuraTestHelper so they can be used at the same time, | 55 // AshTestHelper and AuraTestHelper so they can be used at the same time, |
57 // perhaps by AshTestHelper owning an AuraTestHelper. | 56 // perhaps by AshTestHelper owning an AuraTestHelper. |
58 ash_test_environment_ = base::MakeUnique<AshTestEnvironmentChrome>(); | 57 ash_test_helper_.reset(new ash::test::AshTestHelper( |
59 ash_test_helper_.reset( | 58 base::MessageLoopForUI::current())); |
60 new ash::test::AshTestHelper(ash_test_environment_.get())); | |
61 ash_test_helper_->SetUp(true, | 59 ash_test_helper_->SetUp(true, |
62 ash::MaterialDesignController::Mode::UNINITIALIZED); | 60 ash::MaterialDesignController::Mode::UNINITIALIZED); |
63 #elif defined(TOOLKIT_VIEWS) | 61 #elif defined(TOOLKIT_VIEWS) |
64 views_test_helper_.reset(new views::ScopedViewsTestHelper()); | 62 views_test_helper_.reset(new views::ScopedViewsTestHelper()); |
65 #endif | 63 #endif |
66 #if defined(TOOLKIT_VIEWS) | 64 #if defined(TOOLKIT_VIEWS) |
67 SetConstrainedWindowViewsClient(CreateChromeConstrainedWindowViewsClient()); | 65 SetConstrainedWindowViewsClient(CreateChromeConstrainedWindowViewsClient()); |
68 #endif | 66 #endif |
69 | 67 |
70 // Subclasses can provide their own Profile. | 68 // Subclasses can provide their own Profile. |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 Browser::CreateParams params(profile); | 229 Browser::CreateParams params(profile); |
232 if (hosted_app) { | 230 if (hosted_app) { |
233 params = Browser::CreateParams::CreateForApp( | 231 params = Browser::CreateParams::CreateForApp( |
234 "Test", true /* trusted_source */, gfx::Rect(), profile); | 232 "Test", true /* trusted_source */, gfx::Rect(), profile); |
235 } else { | 233 } else { |
236 params.type = browser_type; | 234 params.type = browser_type; |
237 } | 235 } |
238 params.window = browser_window; | 236 params.window = browser_window; |
239 return new Browser(params); | 237 return new Browser(params); |
240 } | 238 } |
OLD | NEW |