summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/views/bookmark_bar_view_test.cc24
-rw-r--r--chrome/views/chrome_menu.cc7
2 files changed, 25 insertions, 6 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)
diff --git a/chrome/views/chrome_menu.cc b/chrome/views/chrome_menu.cc
index 309109a..6b1483c 100644
--- a/chrome/views/chrome_menu.cc
+++ b/chrome/views/chrome_menu.cc
@@ -2058,8 +2058,13 @@ void MenuController::SetActiveInstance(MenuController* controller) {
bool MenuController::Dispatch(const MSG& msg) {
DCHECK(blocking_run_);
- if (exit_all_)
+ if (exit_all_) {
+ // We must translate/dispatch the message here, otherwise we would drop
+ // the message on the floor.
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
return false;
+ }
// NOTE: we don't get WM_ACTIVATE or anything else interesting in here.
switch (msg.message) {