Chromium Code Reviews| 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 | 9 |
| 10 #if defined(USE_AURA) | 10 #if defined(USE_AURA) |
| 11 #include "ui/aura/env.h" | 11 #include "ui/aura/env.h" |
| 12 #include "ui/aura/root_window.h" | |
| 12 #include "ui/aura/test/aura_test_helper.h" | 13 #include "ui/aura/test/aura_test_helper.h" |
| 13 #endif | 14 #endif |
| 14 | 15 |
| 15 namespace views { | 16 namespace views { |
| 16 | 17 |
| 17 ViewsTestBase::ViewsTestBase() | 18 ViewsTestBase::ViewsTestBase() |
| 18 : setup_called_(false), | 19 : setup_called_(false), |
| 19 teardown_called_(false) { | 20 teardown_called_(false) { |
| 20 } | 21 } |
| 21 | 22 |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 52 } | 53 } |
| 53 | 54 |
| 54 void ViewsTestBase::RunPendingMessages() { | 55 void ViewsTestBase::RunPendingMessages() { |
| 55 base::RunLoop run_loop; | 56 base::RunLoop run_loop; |
| 56 #if defined(USE_AURA) | 57 #if defined(USE_AURA) |
| 57 run_loop.set_dispatcher(aura::Env::GetInstance()->GetDispatcher()); | 58 run_loop.set_dispatcher(aura::Env::GetInstance()->GetDispatcher()); |
| 58 #endif | 59 #endif |
| 59 run_loop.RunUntilIdle(); | 60 run_loop.RunUntilIdle(); |
| 60 } | 61 } |
| 61 | 62 |
| 63 Widget::InitParams ViewsTestBase::CreateParams( | |
| 64 Widget::InitParams::Type type) { | |
|
Ben Goodger (Google)
2012/11/29 22:16:20
rather than adding this method, can you instead ha
Elliot Glaysher
2012/11/29 22:46:29
That's moving where the global state is. I'd like
| |
| 65 Widget::InitParams params(type); | |
| 66 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | |
| 67 #if defined(USE_AURA) | |
| 68 params.context = aura_test_helper_->root_window(); | |
| 69 #endif | |
| 70 return params; | |
| 71 } | |
| 72 | |
| 62 } // namespace views | 73 } // namespace views |
| OLD | NEW |