diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-22 23:49:34 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-22 23:49:34 +0000 |
commit | e5d8b05f5f57390eab6bea89a35c5dc011df113a (patch) | |
tree | 786f5da1e35a695734f49578998c7eafdd9321c1 /chrome/test/interactive_ui | |
parent | 875ee2360d93c2fd1d41b283723be63e67f78fc6 (diff) | |
download | chromium_src-e5d8b05f5f57390eab6bea89a35c5dc011df113a.zip chromium_src-e5d8b05f5f57390eab6bea89a35c5dc011df113a.tar.gz chromium_src-e5d8b05f5f57390eab6bea89a35c5dc011df113a.tar.bz2 |
Fixes bug in interactive ui tests that appears to only happen on
vista. I believe the bug happens because we're in a nested loop with a
Dispatcher, so that even though we're posting two quits, they both end
up quitting the same loop. Posting a WM_USER event between these two
tickles exitting out of the nested loop, then quitting the outer loop.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/93049
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14272 0039d316-1c4b-4281-b951-d872f2087c98
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(); |