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 "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "chrome/browser/profiles/profile_destroyer.h" | 8 #include "chrome/browser/profiles/profile_destroyer.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_navigator.h" | 10 #include "chrome/browser/ui/browser_navigator.h" |
11 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 11 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
12 #include "chrome/common/render_messages.h" | 12 #include "chrome/common/render_messages.h" |
13 #include "chrome/test/base/testing_profile.h" | 13 #include "chrome/test/base/testing_profile.h" |
14 #include "content/public/browser/navigation_controller.h" | 14 #include "content/public/browser/navigation_controller.h" |
15 #include "content/public/browser/navigation_entry.h" | 15 #include "content/public/browser/navigation_entry.h" |
16 #include "content/public/browser/web_contents.h" | 16 #include "content/public/browser/web_contents.h" |
17 #include "content/public/common/page_transition_types.h" | 17 #include "content/public/common/page_transition_types.h" |
18 #include "content/public/test/test_renderer_host.h" | 18 #include "content/public/test/test_renderer_host.h" |
19 | 19 |
20 #if defined(USE_AURA) | 20 #if defined(USE_AURA) |
21 #include "ui/aura/test/aura_test_helper.h" | 21 #include "ui/aura/test/aura_test_helper.h" |
22 #include "ui/compositor/test/context_factories_for_test.h" | 22 #include "ui/compositor/test/context_factories_for_test.h" |
23 #include "ui/wm/core/default_activation_client.h" | |
24 #endif | 23 #endif |
25 | 24 |
26 #if defined(USE_ASH) | 25 #if defined(USE_ASH) |
27 #include "ash/test/ash_test_helper.h" | 26 #include "ash/test/ash_test_helper.h" |
28 #endif | 27 #endif |
29 | 28 |
30 #if defined(TOOLKIT_VIEWS) | 29 #if defined(TOOLKIT_VIEWS) |
31 #include "ui/views/test/test_views_delegate.h" | 30 #include "ui/views/test/test_views_delegate.h" |
32 #endif | 31 #endif |
33 | 32 |
(...skipping 30 matching lines...) Expand all Loading... |
64 base::MessageLoopForUI::current())); | 63 base::MessageLoopForUI::current())); |
65 ash_test_helper_->SetUp(true); | 64 ash_test_helper_->SetUp(true); |
66 #elif defined(USE_AURA) | 65 #elif defined(USE_AURA) |
67 // The ContextFactory must exist before any Compositors are created. | 66 // The ContextFactory must exist before any Compositors are created. |
68 bool enable_pixel_output = false; | 67 bool enable_pixel_output = false; |
69 ui::InitializeContextFactoryForTests(enable_pixel_output); | 68 ui::InitializeContextFactoryForTests(enable_pixel_output); |
70 | 69 |
71 aura_test_helper_.reset(new aura::test::AuraTestHelper( | 70 aura_test_helper_.reset(new aura::test::AuraTestHelper( |
72 base::MessageLoopForUI::current())); | 71 base::MessageLoopForUI::current())); |
73 aura_test_helper_->SetUp(); | 72 aura_test_helper_->SetUp(); |
74 new wm::DefaultActivationClient(aura_test_helper_->root_window()); | |
75 #endif // USE_AURA | 73 #endif // USE_AURA |
76 #if defined(TOOLKIT_VIEWS) | 74 #if defined(TOOLKIT_VIEWS) |
77 views_delegate_.reset(CreateViewsDelegate()); | 75 views_delegate_.reset(CreateViewsDelegate()); |
78 views::ViewsDelegate::views_delegate = views_delegate_.get(); | 76 views::ViewsDelegate::views_delegate = views_delegate_.get(); |
79 #endif | 77 #endif |
80 | 78 |
81 // Subclasses can provide their own Profile. | 79 // Subclasses can provide their own Profile. |
82 profile_ = CreateProfile(); | 80 profile_ = CreateProfile(); |
83 // Subclasses can provide their own test BrowserWindow. If they return NULL | 81 // Subclasses can provide their own test BrowserWindow. If they return NULL |
84 // then Browser will create the a production BrowserWindow and the subclass | 82 // then Browser will create the a production BrowserWindow and the subclass |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 } | 237 } |
240 params.window = browser_window; | 238 params.window = browser_window; |
241 return new Browser(params); | 239 return new Browser(params); |
242 } | 240 } |
243 | 241 |
244 #if defined(TOOLKIT_VIEWS) | 242 #if defined(TOOLKIT_VIEWS) |
245 views::ViewsDelegate* BrowserWithTestWindowTest::CreateViewsDelegate() { | 243 views::ViewsDelegate* BrowserWithTestWindowTest::CreateViewsDelegate() { |
246 return new views::TestViewsDelegate; | 244 return new views::TestViewsDelegate; |
247 } | 245 } |
248 #endif | 246 #endif |
OLD | NEW |