summaryrefslogtreecommitdiffstats
path: root/chrome/test/base/view_event_test_base.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test/base/view_event_test_base.cc')
-rw-r--r--chrome/test/base/view_event_test_base.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/chrome/test/base/view_event_test_base.cc b/chrome/test/base/view_event_test_base.cc
index f370e3d..facfd59 100644
--- a/chrome/test/base/view_event_test_base.cc
+++ b/chrome/test/base/view_event_test_base.cc
@@ -70,9 +70,11 @@ void ViewEventTestBase::Done() {
PostMessage(window_->GetNativeWindow(), WM_USER, 0, 0);
#endif
- // If we're in a nested message loop, as is the case with menus, we need
- // to quit twice. The second quit does that for us.
- MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
+ // If we're in a nested message loop, as is the case with menus, we
+ // need to quit twice. The second quit does that for us. Finish all
+ // pending UI events before posting closure because events it may be
+ // executed before UI events are executed.
+ ui_controls::RunClosureAfterAllPendingUIEvents(MessageLoop::QuitClosure());
}
void ViewEventTestBase::SetUp() {