Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Unified Diff: chrome/test/base/view_event_test_base.cc

Issue 8799020: process all ui events before posting closure because menu depends (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win fix Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/automation/ui_controls_win.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/base/view_event_test_base.cc
diff --git a/chrome/test/base/view_event_test_base.cc b/chrome/test/base/view_event_test_base.cc
index f370e3d34cad17f463ccae93e361bf81a8ff61cd..facfd59f1075be4dee4d4ec7f31e085d0f7c2c6b 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() {
« no previous file with comments | « chrome/browser/automation/ui_controls_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698