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 #if defined(USE_AURA) | 7 #if defined(USE_AURA) |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/env.h" | 10 #include "ui/aura/env.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // Flush the message loop because we have pending release tasks | 59 // Flush the message loop because we have pending release tasks |
60 // and these tasks if un-executed would upset Valgrind. | 60 // and these tasks if un-executed would upset Valgrind. |
61 RunPendingMessages(); | 61 RunPendingMessages(); |
62 teardown_called_ = true; | 62 teardown_called_ = true; |
63 views_delegate_.reset(); | 63 views_delegate_.reset(); |
64 testing::Test::TearDown(); | 64 testing::Test::TearDown(); |
65 #if defined(USE_AURA) | 65 #if defined(USE_AURA) |
66 test_stacking_client_.reset(); | 66 test_stacking_client_.reset(); |
67 test_activation_client_.reset(); | 67 test_activation_client_.reset(); |
68 root_window_.reset(); | 68 root_window_.reset(); |
| 69 aura::Env::DeleteInstance(); |
69 #endif | 70 #endif |
70 } | 71 } |
71 | 72 |
72 void ViewsTestBase::RunPendingMessages() { | 73 void ViewsTestBase::RunPendingMessages() { |
73 #if defined(USE_AURA) | 74 #if defined(USE_AURA) |
74 message_loop_.RunAllPendingWithDispatcher( | 75 message_loop_.RunAllPendingWithDispatcher( |
75 aura::Env::GetInstance()->GetDispatcher()); | 76 aura::Env::GetInstance()->GetDispatcher()); |
76 #else | 77 #else |
77 message_loop_.RunAllPending(); | 78 message_loop_.RunAllPending(); |
78 #endif | 79 #endif |
79 } | 80 } |
80 | 81 |
81 } // namespace views | 82 } // namespace views |
OLD | NEW |