| 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 "chrome/test/base/view_event_test_base.h" | 5 #include "chrome/test/base/view_event_test_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 shell_delegate->test_session_state_delegate() | 134 shell_delegate->test_session_state_delegate() |
| 135 ->SetActiveUserSessionStarted(true); | 135 ->SetActiveUserSessionStarted(true); |
| 136 context = ash::Shell::GetPrimaryRootWindow(); | 136 context = ash::Shell::GetPrimaryRootWindow(); |
| 137 #endif // !OS_WIN | 137 #endif // !OS_WIN |
| 138 aura::Env::CreateInstance(); | 138 aura::Env::CreateInstance(); |
| 139 #elif defined(USE_AURA) | 139 #elif defined(USE_AURA) |
| 140 // Instead of using the ash shell, use an AuraTestHelper to create and manage | 140 // Instead of using the ash shell, use an AuraTestHelper to create and manage |
| 141 // the test screen. | 141 // the test screen. |
| 142 aura_test_helper_.reset( | 142 aura_test_helper_.reset( |
| 143 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); | 143 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); |
| 144 aura_test_helper_->SetUp(); | 144 bool allow_test_contexts = true; |
| 145 aura_test_helper_->SetUp(allow_test_contexts); |
| 145 context = aura_test_helper_->root_window(); | 146 context = aura_test_helper_->root_window(); |
| 146 #endif // !USE_ASH && USE_AURA | 147 #endif // !USE_ASH && USE_AURA |
| 147 | 148 |
| 148 window_ = views::Widget::CreateWindowWithContext(this, context); | 149 window_ = views::Widget::CreateWindowWithContext(this, context); |
| 149 } | 150 } |
| 150 | 151 |
| 151 void ViewEventTestBase::TearDown() { | 152 void ViewEventTestBase::TearDown() { |
| 152 if (window_) { | 153 if (window_) { |
| 153 #if defined(OS_WIN) && !defined(USE_AURA) | 154 #if defined(OS_WIN) && !defined(USE_AURA) |
| 154 DestroyWindow(window_->GetNativeWindow()); | 155 DestroyWindow(window_->GetNativeWindow()); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 dnd_thread_.reset(NULL); | 248 dnd_thread_.reset(NULL); |
| 248 } | 249 } |
| 249 | 250 |
| 250 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { | 251 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { |
| 251 StopBackgroundThread(); | 252 StopBackgroundThread(); |
| 252 | 253 |
| 253 task.Run(); | 254 task.Run(); |
| 254 if (HasFatalFailure()) | 255 if (HasFatalFailure()) |
| 255 Done(); | 256 Done(); |
| 256 } | 257 } |
| OLD | NEW |