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 "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/test/test_shell_delegate.h" | 8 #include "ash/test/test_shell_delegate.h" |
9 #include "ui/aura/root_window.h" | 9 #include "ui/aura/root_window.h" |
10 #include "ui/gfx/compositor/layer_animator.h" | 10 #include "ui/gfx/compositor/layer_animator.h" |
11 | 11 |
12 namespace ash { | 12 namespace ash { |
13 namespace test { | 13 namespace test { |
14 | 14 |
15 AshTestBase::AshTestBase() { | 15 AshTestBase::AshTestBase() { |
16 } | 16 } |
17 | 17 |
18 AshTestBase::~AshTestBase() { | 18 AshTestBase::~AshTestBase() { |
19 } | 19 } |
20 | 20 |
21 void AshTestBase::SetUp() { | 21 void AshTestBase::SetUp() { |
22 // Creates Shell and hook with Desktop. | 22 // Creates Shell and hook with Desktop. |
23 TestShellDelegate* delegate = new TestShellDelegate; | 23 TestShellDelegate* delegate = new TestShellDelegate; |
24 Shell::WindowMode window_mode = Shell::MODE_OVERLAPPING; | 24 Shell::WindowMode window_mode = Shell::MODE_MANAGED; |
25 if (GetOverrideWindowMode(&window_mode)) | 25 if (GetOverrideWindowMode(&window_mode)) |
26 delegate->SetOverrideWindowMode(window_mode); | 26 delegate->SetOverrideWindowMode(window_mode); |
27 ash::Shell::CreateInstance(delegate); | 27 ash::Shell::CreateInstance(delegate); |
28 | 28 |
29 helper_.SetUp(); | 29 helper_.SetUp(); |
30 helper_.InitRootWindow(Shell::GetRootWindow()); | 30 helper_.InitRootWindow(Shell::GetRootWindow()); |
31 | 31 |
32 // Disable animations during tests. | 32 // Disable animations during tests. |
33 ui::LayerAnimator::set_disable_animations_for_test(true); | 33 ui::LayerAnimator::set_disable_animations_for_test(true); |
34 } | 34 } |
(...skipping 11 matching lines...) Expand all Loading... |
46 bool AshTestBase::GetOverrideWindowMode(Shell::WindowMode* window_mode) { | 46 bool AshTestBase::GetOverrideWindowMode(Shell::WindowMode* window_mode) { |
47 return false; | 47 return false; |
48 } | 48 } |
49 | 49 |
50 void AshTestBase::RunAllPendingInMessageLoop() { | 50 void AshTestBase::RunAllPendingInMessageLoop() { |
51 helper_.RunAllPendingInMessageLoop(Shell::GetRootWindow()); | 51 helper_.RunAllPendingInMessageLoop(Shell::GetRootWindow()); |
52 } | 52 } |
53 | 53 |
54 } // namespace test | 54 } // namespace test |
55 } // namespace ash | 55 } // namespace ash |
OLD | NEW |