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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 CHECK(teardown_called_) | 72 CHECK(teardown_called_) |
73 << "You have overrideen TearDown but never called super class's TearDown"; | 73 << "You have overrideen TearDown but never called super class's TearDown"; |
74 } | 74 } |
75 | 75 |
76 void ViewsTestBase::SetUp() { | 76 void ViewsTestBase::SetUp() { |
77 testing::Test::SetUp(); | 77 testing::Test::SetUp(); |
78 setup_called_ = true; | 78 setup_called_ = true; |
79 if (!views_delegate_.get()) | 79 if (!views_delegate_.get()) |
80 views_delegate_.reset(new TestViewsDelegate()); | 80 views_delegate_.reset(new TestViewsDelegate()); |
81 #if defined(USE_AURA) | 81 #if defined(USE_AURA) |
82 root_window_.reset(aura::Env::GetInstance()->monitor_manager()-> | 82 root_window_.reset(aura::MonitorManager::CreateRootWindowForPrimaryMonitor()); |
83 CreateRootWindowForPrimaryMonitor()); | |
84 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get())); | 83 gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get())); |
85 root_window_->SetProperty( | 84 root_window_->SetProperty( |
86 aura::client::kRootWindowInputMethodKey, | 85 aura::client::kRootWindowInputMethodKey, |
87 test_input_method_.get()); | 86 test_input_method_.get()); |
88 test_activation_client_.reset( | 87 test_activation_client_.reset( |
89 new aura::test::TestActivationClient(root_window_.get())); | 88 new aura::test::TestActivationClient(root_window_.get())); |
90 test_stacking_client_.reset( | 89 test_stacking_client_.reset( |
91 new aura::test::TestStackingClient(root_window_.get())); | 90 new aura::test::TestStackingClient(root_window_.get())); |
92 #endif | 91 #endif |
93 } | 92 } |
(...skipping 15 matching lines...) Expand all Loading... |
109 void ViewsTestBase::RunPendingMessages() { | 108 void ViewsTestBase::RunPendingMessages() { |
110 #if defined(USE_AURA) | 109 #if defined(USE_AURA) |
111 message_loop_.RunAllPendingWithDispatcher( | 110 message_loop_.RunAllPendingWithDispatcher( |
112 aura::Env::GetInstance()->GetDispatcher()); | 111 aura::Env::GetInstance()->GetDispatcher()); |
113 #else | 112 #else |
114 message_loop_.RunAllPending(); | 113 message_loop_.RunAllPending(); |
115 #endif | 114 #endif |
116 } | 115 } |
117 | 116 |
118 } // namespace views | 117 } // namespace views |
OLD | NEW |