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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <ole2.h> | 8 #include <ole2.h> |
9 #endif // defined(OS_WIN) | 9 #endif // defined(OS_WIN) |
10 | 10 |
11 #include "chrome/browser/tabs/tab_strip_model.h" | 11 #include "chrome/browser/tabs/tab_strip_model.h" |
12 #include "chrome/browser/ui/browser_navigator.h" | 12 #include "chrome/browser/ui/browser_navigator.h" |
13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
14 #include "chrome/common/render_messages.h" | 14 #include "chrome/common/render_messages.h" |
15 #include "chrome/test/base/testing_profile.h" | 15 #include "chrome/test/base/testing_profile.h" |
16 #include "content/public/browser/navigation_controller.h" | 16 #include "content/public/browser/navigation_controller.h" |
17 #include "content/public/browser/navigation_entry.h" | 17 #include "content/public/browser/navigation_entry.h" |
18 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
19 #include "content/public/common/page_transition_types.h" | 19 #include "content/public/common/page_transition_types.h" |
20 #include "content/test/test_renderer_host.h" | 20 #include "content/test/test_renderer_host.h" |
21 | 21 |
22 #if defined(USE_AURA) | 22 #if defined(USE_AURA) |
| 23 #include "ui/aura/env.h" |
| 24 #include "ui/aura/monitor_manager.h" |
23 #include "ui/aura/root_window.h" | 25 #include "ui/aura/root_window.h" |
24 #include "ui/aura/test/test_activation_client.h" | 26 #include "ui/aura/test/test_activation_client.h" |
25 #include "ui/aura/test/test_screen.h" | 27 #include "ui/aura/test/test_screen.h" |
26 #include "ui/aura/test/test_stacking_client.h" | 28 #include "ui/aura/test/test_stacking_client.h" |
27 #endif | 29 #endif |
28 | 30 |
29 using content::BrowserThread; | 31 using content::BrowserThread; |
30 using content::NavigationController; | 32 using content::NavigationController; |
31 using content::RenderViewHost; | 33 using content::RenderViewHost; |
32 using content::RenderViewHostTester; | 34 using content::RenderViewHostTester; |
(...skipping 11 matching lines...) Expand all Loading... |
44 | 46 |
45 void BrowserWithTestWindowTest::SetUp() { | 47 void BrowserWithTestWindowTest::SetUp() { |
46 testing::Test::SetUp(); | 48 testing::Test::SetUp(); |
47 | 49 |
48 profile_.reset(CreateProfile()); | 50 profile_.reset(CreateProfile()); |
49 browser_.reset(new Browser(Browser::TYPE_TABBED, profile())); | 51 browser_.reset(new Browser(Browser::TYPE_TABBED, profile())); |
50 window_.reset(new TestBrowserWindow(browser())); | 52 window_.reset(new TestBrowserWindow(browser())); |
51 browser_->SetWindowForTesting(window_.get()); | 53 browser_->SetWindowForTesting(window_.get()); |
52 #if defined(USE_AURA) | 54 #if defined(USE_AURA) |
53 root_window_.reset(new aura::RootWindow); | 55 root_window_.reset(new aura::RootWindow); |
| 56 aura::Env::GetInstance()->SetMonitorManager( |
| 57 aura::CreateSingleMonitorManager(root_window_.get())); |
54 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get())); | 58 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get())); |
55 test_activation_client_.reset( | 59 test_activation_client_.reset( |
56 new aura::test::TestActivationClient(root_window_.get())); | 60 new aura::test::TestActivationClient(root_window_.get())); |
57 test_stacking_client_.reset( | 61 test_stacking_client_.reset( |
58 new aura::test::TestStackingClient(root_window_.get())); | 62 new aura::test::TestStackingClient(root_window_.get())); |
59 #endif | 63 #endif |
60 } | 64 } |
61 | 65 |
62 void BrowserWithTestWindowTest::TearDown() { | 66 void BrowserWithTestWindowTest::TearDown() { |
63 testing::Test::TearDown(); | 67 testing::Test::TearDown(); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // Make sure we close all tabs, otherwise Browser isn't happy in its | 154 // Make sure we close all tabs, otherwise Browser isn't happy in its |
151 // destructor. | 155 // destructor. |
152 browser()->CloseAllTabs(); | 156 browser()->CloseAllTabs(); |
153 browser_.reset(NULL); | 157 browser_.reset(NULL); |
154 window_.reset(NULL); | 158 window_.reset(NULL); |
155 } | 159 } |
156 | 160 |
157 TestingProfile* BrowserWithTestWindowTest::CreateProfile() { | 161 TestingProfile* BrowserWithTestWindowTest::CreateProfile() { |
158 return new TestingProfile(); | 162 return new TestingProfile(); |
159 } | 163 } |
OLD | NEW |