| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <ole2.h> | 8 #include <ole2.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 // Flush the message loop because we have pending release tasks | 39 // Flush the message loop because we have pending release tasks |
| 40 // and these tasks if un-executed would upset Valgrind. | 40 // and these tasks if un-executed would upset Valgrind. |
| 41 message_loop_.RunAllPendingWithDispatcher( | 41 message_loop_.RunAllPendingWithDispatcher( |
| 42 Desktop::GetInstance()->GetDispatcher()); | 42 Desktop::GetInstance()->GetDispatcher()); |
| 43 | 43 |
| 44 // Ensure that we don't use the previously-allocated static Desktop object | 44 // Ensure that we don't use the previously-allocated static Desktop object |
| 45 // later -- on Linux, it holds a reference to our message loop's X connection. | 45 // later -- on Linux, it holds a reference to our message loop's X connection. |
| 46 aura::Desktop::DeleteInstanceForTesting(); | 46 aura::Desktop::DeleteInstanceForTesting(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 TestDesktopDelegate* AuraTestBase::GetTestDesktopDelegate() { |
| 50 return static_cast<TestDesktopDelegate*>( |
| 51 aura::Desktop::GetInstance()->delegate()); |
| 52 } |
| 53 |
| 49 void AuraTestBase::SetUp() { | 54 void AuraTestBase::SetUp() { |
| 50 testing::Test::SetUp(); | 55 testing::Test::SetUp(); |
| 51 setup_called_ = true; | 56 setup_called_ = true; |
| 52 } | 57 } |
| 53 | 58 |
| 54 void AuraTestBase::TearDown() { | 59 void AuraTestBase::TearDown() { |
| 55 teardown_called_ = true; | 60 teardown_called_ = true; |
| 56 testing::Test::TearDown(); | 61 testing::Test::TearDown(); |
| 57 } | 62 } |
| 58 | 63 |
| 59 } // namespace test | 64 } // namespace test |
| 60 } // namespace aura | 65 } // namespace aura |
| OLD | NEW |