| 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/aura_test_base.h" | 5 #include "ui/aura/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 25 matching lines...) Expand all Loading... |
| 36 << "You have overrideen TearDown but never called super class's TearDown"; | 36 << "You have overrideen TearDown but never called super class's TearDown"; |
| 37 } | 37 } |
| 38 | 38 |
| 39 void AuraTestBase::SetUp() { | 39 void AuraTestBase::SetUp() { |
| 40 testing::Test::SetUp(); | 40 testing::Test::SetUp(); |
| 41 setup_called_ = true; | 41 setup_called_ = true; |
| 42 aura::Desktop::set_compositor_factory_for_testing(&TestCreateCompositor); | 42 aura::Desktop::set_compositor_factory_for_testing(&TestCreateCompositor); |
| 43 // TestDesktopDelegate is owned by the desktop. | 43 // TestDesktopDelegate is owned by the desktop. |
| 44 new TestDesktopDelegate(); | 44 new TestDesktopDelegate(); |
| 45 Desktop::GetInstance()->Show(); | 45 Desktop::GetInstance()->Show(); |
| 46 Desktop::GetInstance()->SetSize(gfx::Size(500, 500)); | 46 Desktop::GetInstance()->SetSize(gfx::Size(600, 600)); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void AuraTestBase::TearDown() { | 49 void AuraTestBase::TearDown() { |
| 50 // Flush the message loop because we have pending release tasks | 50 // Flush the message loop because we have pending release tasks |
| 51 // and these tasks if un-executed would upset Valgrind. | 51 // and these tasks if un-executed would upset Valgrind. |
| 52 RunPendingMessages(); | 52 RunPendingMessages(); |
| 53 teardown_called_ = true; | 53 teardown_called_ = true; |
| 54 testing::Test::TearDown(); | 54 testing::Test::TearDown(); |
| 55 aura::Desktop::set_compositor_factory_for_testing(NULL); | 55 aura::Desktop::set_compositor_factory_for_testing(NULL); |
| 56 } | 56 } |
| 57 | 57 |
| 58 } // namespace aura | 58 } // namespace aura |
| OLD | NEW |