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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 RunAllPendingInMessageLoop(); | 67 RunAllPendingInMessageLoop(); |
68 | 68 |
69 // Tear down the shell. | 69 // Tear down the shell. |
70 Shell::DeleteInstance(); | 70 Shell::DeleteInstance(); |
71 aura::Env::DeleteInstance(); | 71 aura::Env::DeleteInstance(); |
72 ui::TextInputTestSupport::Shutdown(); | 72 ui::TextInputTestSupport::Shutdown(); |
73 } | 73 } |
74 | 74 |
75 void AshTestBase::ChangeMonitorConfig(float scale, | 75 void AshTestBase::ChangeMonitorConfig(float scale, |
76 const gfx::Rect& bounds_in_pixel) { | 76 const gfx::Rect& bounds_in_pixel) { |
77 gfx::Display display = gfx::Display(gfx::Screen::GetPrimaryMonitor().id()); | 77 gfx::Display display = gfx::Display(gfx::Screen::GetPrimaryDisplay().id()); |
78 display.SetScaleAndBounds(scale, bounds_in_pixel); | 78 display.SetScaleAndBounds(scale, bounds_in_pixel); |
79 std::vector<gfx::Display> displays; | 79 std::vector<gfx::Display> displays; |
80 displays.push_back(display); | 80 displays.push_back(display); |
81 aura::Env::GetInstance()->monitor_manager()->OnNativeMonitorsChanged( | 81 aura::Env::GetInstance()->monitor_manager()->OnNativeMonitorsChanged( |
82 displays); | 82 displays); |
83 } | 83 } |
84 | 84 |
85 void AshTestBase::UpdateMonitor(const std::string& display_specs) { | 85 void AshTestBase::UpdateMonitor(const std::string& display_specs) { |
86 std::vector<gfx::Display> displays = CreateDisplaysFromString(display_specs); | 86 std::vector<gfx::Display> displays = CreateDisplaysFromString(display_specs); |
87 aura::Env::GetInstance()->monitor_manager()-> | 87 aura::Env::GetInstance()->monitor_manager()-> |
88 OnNativeMonitorsChanged(displays); | 88 OnNativeMonitorsChanged(displays); |
89 } | 89 } |
90 | 90 |
91 void AshTestBase::RunAllPendingInMessageLoop() { | 91 void AshTestBase::RunAllPendingInMessageLoop() { |
92 #if !defined(OS_MACOSX) | 92 #if !defined(OS_MACOSX) |
93 message_loop_.RunAllPendingWithDispatcher( | 93 message_loop_.RunAllPendingWithDispatcher( |
94 aura::Env::GetInstance()->GetDispatcher()); | 94 aura::Env::GetInstance()->GetDispatcher()); |
95 #endif | 95 #endif |
96 } | 96 } |
97 | 97 |
98 } // namespace test | 98 } // namespace test |
99 } // namespace ash | 99 } // namespace ash |
OLD | NEW |