diff options
Diffstat (limited to 'chrome/test/interactive_ui')
-rw-r--r-- | chrome/test/interactive_ui/view_event_test_base.cc | 10 | ||||
-rw-r--r-- | chrome/test/interactive_ui/view_event_test_base.h | 6 |
2 files changed, 10 insertions, 6 deletions
diff --git a/chrome/test/interactive_ui/view_event_test_base.cc b/chrome/test/interactive_ui/view_event_test_base.cc index baae933..0af65ef 100644 --- a/chrome/test/interactive_ui/view_event_test_base.cc +++ b/chrome/test/interactive_ui/view_event_test_base.cc @@ -39,17 +39,21 @@ const int kMouseMoveDelayMS = 200; } // namespace -// static +ViewEventTestBase::ViewEventTestBase() : window_(NULL), content_view_(NULL) { } + void ViewEventTestBase::Done() { MessageLoop::current()->Quit(); + + // We need to post a message to tickle the Dispatcher getting called and + // exiting out of the nested loop. Without this the quit never runs. + PostMessage(window_->GetNativeWindow(), WM_USER, 0, 0); + // 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()->PostDelayedTask( FROM_HERE, new MessageLoop::QuitTask(), 0); } -ViewEventTestBase::ViewEventTestBase() : window_(NULL), content_view_(NULL) { } - void ViewEventTestBase::SetUp() { OleInitialize(NULL); window_ = views::Window::CreateChromeWindow(NULL, gfx::Rect(), this); diff --git a/chrome/test/interactive_ui/view_event_test_base.h b/chrome/test/interactive_ui/view_event_test_base.h index 4b56d12..fa01e81 100644 --- a/chrome/test/interactive_ui/view_event_test_base.h +++ b/chrome/test/interactive_ui/view_event_test_base.h @@ -56,11 +56,11 @@ class Size; class ViewEventTestBase : public views::WindowDelegate, public testing::Test { public: + ViewEventTestBase(); + // Invoke when done either because of failure or success. Quits the message // loop. - static void Done(); - - ViewEventTestBase(); + void Done(); // Creates a window. virtual void SetUp(); |