summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/bookmark_bar_view_test.cc
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-17 22:47:53 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-17 22:47:53 +0000
commit4b32ec16a42cc947ecef5f9f185c20e96fd6b6d3 (patch)
treecec80942545cb6bf5455c9e7be0ade8f9508b4a3 /chrome/browser/views/bookmark_bar_view_test.cc
parent3acfbd20fb06a44ae39a884b0179b03229602bcc (diff)
downloadchromium_src-4b32ec16a42cc947ecef5f9f185c20e96fd6b6d3.zip
chromium_src-4b32ec16a42cc947ecef5f9f185c20e96fd6b6d3.tar.gz
chromium_src-4b32ec16a42cc947ecef5f9f185c20e96fd6b6d3.tar.bz2
Changes menu's Dispatcher to translate/dispatch message before
returning false. This way we don't screw up the message pump. I also needed to slightly tweak the bookmark bar test that was hitting this code path. BUG=none TEST=none Review URL: http://codereview.chromium.org/15008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7177 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/bookmark_bar_view_test.cc')
-rw-r--r--chrome/browser/views/bookmark_bar_view_test.cc24
1 files changed, 19 insertions, 5 deletions
diff --git a/chrome/browser/views/bookmark_bar_view_test.cc b/chrome/browser/views/bookmark_bar_view_test.cc
index 2477929..1e6a0b8 100644
--- a/chrome/browser/views/bookmark_bar_view_test.cc
+++ b/chrome/browser/views/bookmark_bar_view_test.cc
@@ -939,24 +939,38 @@ class BookmarkBarViewTest12 : public BookmarkBarViewEventTestBase {
ASSERT_TRUE(child_menu != NULL);
ui_controls::MoveMouseToCenterAndPress(child_menu, ui_controls::LEFT,
ui_controls::DOWN | ui_controls::UP, NULL);
+
+ // Delay until we send tab, otherwise the message box doesn't appear
+ // correctly.
+ MessageLoop::current()->PostDelayedTask(FROM_HERE,
+ CreateEventTask(this, &BookmarkBarViewTest12::Step4), 1000);
+ }
+ void Step4() {
// Press tab to give focus to the cancel button.
ui_controls::SendKeyPressNotifyWhenDone(VK_TAB, false, false, false,
NULL);
+
+ // For some reason return isn't processed correctly unless we delay.
+ MessageLoop::current()->PostDelayedTask(FROM_HERE,
+ CreateEventTask(this, &BookmarkBarViewTest12::Step5), 1000);
+ }
+
+ void Step5() {
// And press enter so that the cancel button is selected.
ui_controls::SendKeyPressNotifyWhenDone(VK_RETURN, false, false, false,
- CreateEventTask(this, &BookmarkBarViewTest12::Step4));
+ CreateEventTask(this, &BookmarkBarViewTest12::Step6));
}
- void Step4() {
+ void Step6() {
// Do a delayed task to give the dialog time to exit.
MessageLoop::current()->PostTask(
- FROM_HERE, CreateEventTask(this, &BookmarkBarViewTest12::Step5));
+ FROM_HERE, CreateEventTask(this, &BookmarkBarViewTest12::Step7));
}
- void Step5() {
+ void Step7() {
Done();
}
};
-VIEW_TEST(BookmarkBarViewTest12, DISABLED_CloseWithModalDialog)
+VIEW_TEST(BookmarkBarViewTest12, CloseWithModalDialog)