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