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 "ash/test/ash_test_base.h" | 5 #include "ash/test/ash_test_base.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/test/test_shell_delegate.h" | 10 #include "ash/test/test_shell_delegate.h" |
11 #include "content/public/test/web_contents_tester.h" | 11 #include "content/public/test/web_contents_tester.h" |
12 #include "ui/aura/env.h" | 12 #include "ui/aura/env.h" |
13 #include "ui/aura/monitor_manager.h" | 13 #include "ui/aura/monitor_manager.h" |
14 #include "ui/aura/root_window.h" | 14 #include "ui/aura/root_window.h" |
15 #include "ui/base/ime/text_input_test_support.h" | 15 #include "ui/base/ime/text_input_test_support.h" |
16 #include "ui/compositor/layer_animator.h" | 16 #include "ui/compositor/layer_animator.h" |
17 #include "ui/gfx/monitor.h" | 17 #include "ui/gfx/display.h" |
18 #include "ui/gfx/screen.h" | 18 #include "ui/gfx/screen.h" |
19 | 19 |
20 namespace ash { | 20 namespace ash { |
21 namespace test { | 21 namespace test { |
22 | 22 |
23 content::WebContents* AshTestViewsDelegate::CreateWebContents( | 23 content::WebContents* AshTestViewsDelegate::CreateWebContents( |
24 content::BrowserContext* browser_context, | 24 content::BrowserContext* browser_context, |
25 content::SiteInstance* site_instance) { | 25 content::SiteInstance* site_instance) { |
26 return content::WebContentsTester::CreateTestWebContents(browser_context, | 26 return content::WebContentsTester::CreateTestWebContents(browser_context, |
27 site_instance); | 27 site_instance); |
(...skipping 22 matching lines...) Expand all Loading... |
50 RunAllPendingInMessageLoop(); | 50 RunAllPendingInMessageLoop(); |
51 | 51 |
52 // Tear down the shell. | 52 // Tear down the shell. |
53 Shell::DeleteInstance(); | 53 Shell::DeleteInstance(); |
54 aura::Env::DeleteInstance(); | 54 aura::Env::DeleteInstance(); |
55 ui::TextInputTestSupport::Shutdown(); | 55 ui::TextInputTestSupport::Shutdown(); |
56 } | 56 } |
57 | 57 |
58 void AshTestBase::ChangeMonitorConfig(float scale, | 58 void AshTestBase::ChangeMonitorConfig(float scale, |
59 const gfx::Rect& bounds_in_pixel) { | 59 const gfx::Rect& bounds_in_pixel) { |
60 gfx::Monitor monitor = gfx::Monitor(gfx::Screen::GetPrimaryMonitor().id()); | 60 gfx::Display display = gfx::Display(gfx::Screen::GetPrimaryMonitor().id()); |
61 monitor.SetScaleAndBounds(scale, bounds_in_pixel); | 61 display.SetScaleAndBounds(scale, bounds_in_pixel); |
62 std::vector<gfx::Monitor> monitors; | 62 std::vector<gfx::Display> displays; |
63 monitors.push_back(monitor); | 63 displays.push_back(display); |
64 aura::Env::GetInstance()->monitor_manager()->OnNativeMonitorsChanged( | 64 aura::Env::GetInstance()->monitor_manager()->OnNativeMonitorsChanged( |
65 monitors); | 65 displays); |
66 } | 66 } |
67 | 67 |
68 void AshTestBase::RunAllPendingInMessageLoop() { | 68 void AshTestBase::RunAllPendingInMessageLoop() { |
69 #if !defined(OS_MACOSX) | 69 #if !defined(OS_MACOSX) |
70 message_loop_.RunAllPendingWithDispatcher( | 70 message_loop_.RunAllPendingWithDispatcher( |
71 aura::Env::GetInstance()->GetDispatcher()); | 71 aura::Env::GetInstance()->GetDispatcher()); |
72 #endif | 72 #endif |
73 } | 73 } |
74 | 74 |
75 } // namespace test | 75 } // namespace test |
76 } // namespace ash | 76 } // namespace ash |
OLD | NEW |