| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 ui::LayerAnimator::set_disable_animations_for_test(true); | 58 ui::LayerAnimator::set_disable_animations_for_test(true); |
| 59 ui::TextInputTestSupport::Initialize(); | 59 ui::TextInputTestSupport::Initialize(); |
| 60 // Creates Shell and hook with Desktop. | 60 // Creates Shell and hook with Desktop. |
| 61 test_shell_delegate_ = new TestShellDelegate; | 61 test_shell_delegate_ = new TestShellDelegate; |
| 62 ash::Shell::CreateInstance(test_shell_delegate_); | 62 ash::Shell::CreateInstance(test_shell_delegate_); |
| 63 Shell::GetPrimaryRootWindow()->Show(); | 63 Shell::GetPrimaryRootWindow()->Show(); |
| 64 Shell::GetPrimaryRootWindow()->ShowRootWindow(); | 64 Shell::GetPrimaryRootWindow()->ShowRootWindow(); |
| 65 // Move the mouse cursor to far away so that native events doesn't | 65 // Move the mouse cursor to far away so that native events doesn't |
| 66 // interfere test expectations. | 66 // interfere test expectations. |
| 67 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); | 67 Shell::GetPrimaryRootWindow()->MoveCursorTo(gfx::Point(-1000, -1000)); |
| 68 Shell::GetInstance()->cursor_manager()->ShowCursor(true); | 68 Shell::GetInstance()->cursor_manager()->EnableMouseEvents(); |
| 69 } | 69 } |
| 70 | 70 |
| 71 void AshTestBase::TearDown() { | 71 void AshTestBase::TearDown() { |
| 72 // Flush the message loop to finish pending release tasks. | 72 // Flush the message loop to finish pending release tasks. |
| 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(); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 void AshTestBase::SetUserLoggedIn(bool user_logged_in) { | 160 void AshTestBase::SetUserLoggedIn(bool user_logged_in) { |
| 161 test_shell_delegate_->SetUserLoggedIn(user_logged_in); | 161 test_shell_delegate_->SetUserLoggedIn(user_logged_in); |
| 162 } | 162 } |
| 163 | 163 |
| 164 void AshTestBase::SetCanLockScreen(bool can_lock_screen) { | 164 void AshTestBase::SetCanLockScreen(bool can_lock_screen) { |
| 165 test_shell_delegate_->SetCanLockScreen(can_lock_screen); | 165 test_shell_delegate_->SetCanLockScreen(can_lock_screen); |
| 166 } | 166 } |
| 167 | 167 |
| 168 } // namespace test | 168 } // namespace test |
| 169 } // namespace ash | 169 } // namespace ash |
| OLD | NEW |