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/views/test/views_test_base.h" | 5 #include "ui/views/test/views_test_base.h" |
6 | 6 |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "ui/base/clipboard/clipboard.h" | 8 #include "ui/base/clipboard/clipboard.h" |
9 #include "ui/base/ime/input_method_initializer.h" | 9 #include "ui/base/ime/input_method_initializer.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 << "You have overrideen TearDown but never called super class's TearDown"; | 30 << "You have overrideen TearDown but never called super class's TearDown"; |
31 } | 31 } |
32 | 32 |
33 void ViewsTestBase::SetUp() { | 33 void ViewsTestBase::SetUp() { |
34 testing::Test::SetUp(); | 34 testing::Test::SetUp(); |
35 setup_called_ = true; | 35 setup_called_ = true; |
36 if (!views_delegate_.get()) | 36 if (!views_delegate_.get()) |
37 views_delegate_.reset(new TestViewsDelegate()); | 37 views_delegate_.reset(new TestViewsDelegate()); |
38 #if defined(USE_AURA) | 38 #if defined(USE_AURA) |
39 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); | 39 aura_test_helper_.reset(new aura::test::AuraTestHelper(&message_loop_)); |
40 aura_test_helper_->SetUp(); | 40 bool allow_test_contexts = true; |
| 41 aura_test_helper_->SetUp(allow_test_contexts); |
41 wm_state_.reset(new views::corewm::WMState); | 42 wm_state_.reset(new views::corewm::WMState); |
42 #endif // USE_AURA | 43 #endif // USE_AURA |
43 ui::InitializeInputMethodForTesting(); | 44 ui::InitializeInputMethodForTesting(); |
44 } | 45 } |
45 | 46 |
46 void ViewsTestBase::TearDown() { | 47 void ViewsTestBase::TearDown() { |
47 ui::Clipboard::DestroyClipboardForCurrentThread(); | 48 ui::Clipboard::DestroyClipboardForCurrentThread(); |
48 | 49 |
49 // Flush the message loop because we have pending release tasks | 50 // Flush the message loop because we have pending release tasks |
50 // and these tasks if un-executed would upset Valgrind. | 51 // and these tasks if un-executed would upset Valgrind. |
(...skipping 28 matching lines...) Expand all Loading... |
79 | 80 |
80 gfx::NativeView ViewsTestBase::GetContext() { | 81 gfx::NativeView ViewsTestBase::GetContext() { |
81 #if defined(USE_AURA) | 82 #if defined(USE_AURA) |
82 return aura_test_helper_->root_window(); | 83 return aura_test_helper_->root_window(); |
83 #else | 84 #else |
84 return NULL; | 85 return NULL; |
85 #endif | 86 #endif |
86 } | 87 } |
87 | 88 |
88 } // namespace views | 89 } // namespace views |
OLD | NEW |