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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 AshTestBase::~AshTestBase() { | 52 AshTestBase::~AshTestBase() { |
53 } | 53 } |
54 | 54 |
55 void AshTestBase::SetUp() { | 55 void AshTestBase::SetUp() { |
56 ui::TextInputTestSupport::Initilaize(); | 56 ui::TextInputTestSupport::Initilaize(); |
57 // Creates Shell and hook with Desktop. | 57 // Creates Shell and hook with Desktop. |
58 TestShellDelegate* delegate = new TestShellDelegate; | 58 TestShellDelegate* delegate = new TestShellDelegate; |
59 ash::Shell::CreateInstance(delegate); | 59 ash::Shell::CreateInstance(delegate); |
60 Shell::GetPrimaryRootWindow()->Show(); | 60 Shell::GetPrimaryRootWindow()->Show(); |
61 Shell::GetPrimaryRootWindow()->SetHostSize(gfx::Size(800, 600)); | 61 Shell::GetPrimaryRootWindow()->SetHostSize(gfx::Size(800, 600)); |
| 62 Shell::GetInstance()->cursor_manager()->ShowCursor(true); |
62 | 63 |
63 // Disable animations during tests. | 64 // Disable animations during tests. |
64 ui::LayerAnimator::set_disable_animations_for_test(true); | 65 ui::LayerAnimator::set_disable_animations_for_test(true); |
65 } | 66 } |
66 | 67 |
67 void AshTestBase::TearDown() { | 68 void AshTestBase::TearDown() { |
68 // Flush the message loop to finish pending release tasks. | 69 // Flush the message loop to finish pending release tasks. |
69 RunAllPendingInMessageLoop(); | 70 RunAllPendingInMessageLoop(); |
70 | 71 |
71 // Tear down the shell. | 72 // Tear down the shell. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 void AshTestBase::RunAllPendingInMessageLoop() { | 108 void AshTestBase::RunAllPendingInMessageLoop() { |
108 #if !defined(OS_MACOSX) | 109 #if !defined(OS_MACOSX) |
109 DCHECK(MessageLoopForUI::current() == &message_loop_); | 110 DCHECK(MessageLoopForUI::current() == &message_loop_); |
110 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); | 111 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); |
111 run_loop.RunUntilIdle(); | 112 run_loop.RunUntilIdle(); |
112 #endif | 113 #endif |
113 } | 114 } |
114 | 115 |
115 } // namespace test | 116 } // namespace test |
116 } // namespace ash | 117 } // namespace ash |
OLD | NEW |