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