| 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/display/display_controller.h" | 10 #include "ash/display/display_controller.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 RunAllPendingInMessageLoop(); | 73 RunAllPendingInMessageLoop(); |
| 74 | 74 |
| 75 // Tear down the shell. | 75 // Tear down the shell. |
| 76 Shell::DeleteInstance(); | 76 Shell::DeleteInstance(); |
| 77 aura::Env::DeleteInstance(); | 77 aura::Env::DeleteInstance(); |
| 78 ui::TextInputTestSupport::Shutdown(); | 78 ui::TextInputTestSupport::Shutdown(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void AshTestBase::ChangeDisplayConfig(float scale, | 81 void AshTestBase::ChangeDisplayConfig(float scale, |
| 82 const gfx::Rect& bounds_in_pixel) { | 82 const gfx::Rect& bounds_in_pixel) { |
| 83 gfx::Display display = gfx::Display(gfx::Screen::GetPrimaryDisplay().id()); | 83 gfx::Display display = |
| 84 gfx::Display(Shell::GetAshScreen()->GetPrimaryDisplay().id()); |
| 84 display.SetScaleAndBounds(scale, bounds_in_pixel); | 85 display.SetScaleAndBounds(scale, bounds_in_pixel); |
| 85 std::vector<gfx::Display> displays; | 86 std::vector<gfx::Display> displays; |
| 86 displays.push_back(display); | 87 displays.push_back(display); |
| 87 aura::Env::GetInstance()->display_manager()->OnNativeDisplaysChanged( | 88 aura::Env::GetInstance()->display_manager()->OnNativeDisplaysChanged( |
| 88 displays); | 89 displays); |
| 89 } | 90 } |
| 90 | 91 |
| 91 void AshTestBase::UpdateDisplay(const std::string& display_specs) { | 92 void AshTestBase::UpdateDisplay(const std::string& display_specs) { |
| 92 std::vector<gfx::Display> displays = CreateDisplaysFromString(display_specs); | 93 std::vector<gfx::Display> displays = CreateDisplaysFromString(display_specs); |
| 93 internal::MultiDisplayManager* display_manager = | 94 internal::MultiDisplayManager* display_manager = |
| (...skipping 28 matching lines...) Expand all Loading... |
| 122 void AshTestBase::RunAllPendingInMessageLoop() { | 123 void AshTestBase::RunAllPendingInMessageLoop() { |
| 123 #if !defined(OS_MACOSX) | 124 #if !defined(OS_MACOSX) |
| 124 DCHECK(MessageLoopForUI::current() == &message_loop_); | 125 DCHECK(MessageLoopForUI::current() == &message_loop_); |
| 125 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); | 126 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); |
| 126 run_loop.RunUntilIdle(); | 127 run_loop.RunUntilIdle(); |
| 127 #endif | 128 #endif |
| 128 } | 129 } |
| 129 | 130 |
| 130 } // namespace test | 131 } // namespace test |
| 131 } // namespace ash | 132 } // namespace ash |
| OLD | NEW |