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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <ole2.h> | 8 #include <ole2.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 return gfx::Size(); | 163 return gfx::Size(); |
164 } | 164 } |
165 | 165 |
166 void ViewEventTestBase::ScheduleMouseMoveInBackground(int x, int y) { | 166 void ViewEventTestBase::ScheduleMouseMoveInBackground(int x, int y) { |
167 if (!dnd_thread_.get()) { | 167 if (!dnd_thread_.get()) { |
168 dnd_thread_.reset(new base::Thread("mouse-move-thread")); | 168 dnd_thread_.reset(new base::Thread("mouse-move-thread")); |
169 dnd_thread_->Start(); | 169 dnd_thread_->Start(); |
170 } | 170 } |
171 dnd_thread_->message_loop()->PostDelayedTask( | 171 dnd_thread_->message_loop()->PostDelayedTask( |
172 FROM_HERE, | 172 FROM_HERE, |
173 base::IgnoreReturn<bool>(base::Bind(&ui_controls::SendMouseMove, x, y)), | 173 base::Bind(base::IgnoreResult(&ui_controls::SendMouseMove), x, y), |
174 kMouseMoveDelayMS); | 174 kMouseMoveDelayMS); |
175 } | 175 } |
176 | 176 |
177 void ViewEventTestBase::StopBackgroundThread() { | 177 void ViewEventTestBase::StopBackgroundThread() { |
178 dnd_thread_.reset(NULL); | 178 dnd_thread_.reset(NULL); |
179 } | 179 } |
180 | 180 |
181 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { | 181 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { |
182 StopBackgroundThread(); | 182 StopBackgroundThread(); |
183 | 183 |
184 task.Run(); | 184 task.Run(); |
185 if (HasFatalFailure()) | 185 if (HasFatalFailure()) |
186 Done(); | 186 Done(); |
187 } | 187 } |
OLD | NEW |