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 "ui/aura/test/aura_test_base.h" | 5 #include "ui/aura/test/aura_test_base.h" |
6 | 6 |
| 7 #include "ui/aura/env.h" |
| 8 #include "ui/aura/monitor_manager.h" |
7 #include "ui/aura/root_window.h" | 9 #include "ui/aura/root_window.h" |
8 #include "ui/aura/test/test_screen.h" | 10 #include "ui/aura/test/test_screen.h" |
9 #include "ui/aura/test/test_stacking_client.h" | 11 #include "ui/aura/test/test_stacking_client.h" |
10 | 12 |
11 namespace aura { | 13 namespace aura { |
12 namespace test { | 14 namespace test { |
13 | 15 |
14 AuraTestBase::AuraTestBase() { | 16 AuraTestBase::AuraTestBase() { |
15 } | 17 } |
16 | 18 |
17 AuraTestBase::~AuraTestBase() { | 19 AuraTestBase::~AuraTestBase() { |
18 } | 20 } |
19 | 21 |
20 void AuraTestBase::SetUp() { | 22 void AuraTestBase::SetUp() { |
21 testing::Test::SetUp(); | 23 testing::Test::SetUp(); |
22 root_window_.reset(new aura::RootWindow); | 24 root_window_.reset(new aura::RootWindow); |
23 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get())); | 25 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get())); |
| 26 Env::GetInstance()->SetMonitorManager( |
| 27 CreateSingleMonitorManager(root_window_.get())); |
24 helper_.InitRootWindow(root_window()); | 28 helper_.InitRootWindow(root_window()); |
25 helper_.SetUp(); | 29 helper_.SetUp(); |
26 stacking_client_.reset(new TestStackingClient(root_window())); | 30 stacking_client_.reset(new TestStackingClient(root_window())); |
27 } | 31 } |
28 | 32 |
29 void AuraTestBase::TearDown() { | 33 void AuraTestBase::TearDown() { |
30 // Flush the message loop because we have pending release tasks | 34 // Flush the message loop because we have pending release tasks |
31 // and these tasks if un-executed would upset Valgrind. | 35 // and these tasks if un-executed would upset Valgrind. |
32 RunAllPendingInMessageLoop(); | 36 RunAllPendingInMessageLoop(); |
33 | 37 |
34 stacking_client_.reset(); | 38 stacking_client_.reset(); |
35 helper_.TearDown(); | 39 helper_.TearDown(); |
36 root_window_.reset(); | 40 root_window_.reset(); |
37 testing::Test::TearDown(); | 41 testing::Test::TearDown(); |
38 } | 42 } |
39 | 43 |
40 void AuraTestBase::RunAllPendingInMessageLoop() { | 44 void AuraTestBase::RunAllPendingInMessageLoop() { |
41 helper_.RunAllPendingInMessageLoop(root_window()); | 45 helper_.RunAllPendingInMessageLoop(root_window()); |
42 } | 46 } |
43 | 47 |
44 } // namespace test | 48 } // namespace test |
45 } // namespace aura | 49 } // namespace aura |
OLD | NEW |