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

Unified Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc

Issue 7390032: Fixes regression from menu refactoring. The old windows code wasn't (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename field Created 9 years, 5 months 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 | « no previous file | views/controls/menu/menu_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
index 225284fbc3b01a6eca50aed0651567d75c3540e5..aea8547dd96d48586332f36955d6576728dc4813 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
@@ -1450,3 +1450,47 @@ class BookmarkBarViewTest17 : public BookmarkBarViewEventTestBase {
};
VIEW_TEST(BookmarkBarViewTest17, ContextMenus3)
+
+// Verifies sibling menus works. Clicks on the 'other bookmarks' folder, then
+// moves the mouse over the first item on the bookmark bar and makes sure the
+// menu appears.
+class BookmarkBarViewTest18 : public BookmarkBarViewEventTestBase {
+ protected:
+ virtual void DoTestOnMessageLoop() {
+ // Move the mouse to the other folder on the bookmark bar and press the
+ // left mouse button.
+ views::TextButton* button = bb_view_->other_bookmarked_button();
+ ui_controls::MoveMouseToCenterAndPress(button, ui_controls::LEFT,
+ ui_controls::DOWN | ui_controls::UP,
+ CreateEventTask(this, &BookmarkBarViewTest18::Step2));
+ }
+
+ private:
+ void Step2() {
+ // Menu should be showing.
+ views::MenuItemView* menu = bb_view_->GetMenu();
+ ASSERT_TRUE(menu != NULL);
+ ASSERT_TRUE(menu->GetSubmenu()->IsShowing());
+
+ // Move the mouse to the first folder on the bookmark bar
+ views::TextButton* button = GetBookmarkButton(0);
+ gfx::Point button_center(button->width() / 2, button->height() / 2);
+ views::View::ConvertPointToScreen(button, &button_center);
+ ui_controls::SendMouseMoveNotifyWhenDone(
+ button_center.x(), button_center.y(),
+ CreateEventTask(this, &BookmarkBarViewTest18::Step3));
+ }
+
+ void Step3() {
+ // Make sure the menu is showing.
+ views::MenuItemView* menu = bb_view_->GetMenu();
+ ASSERT_TRUE(menu != NULL);
+ ASSERT_TRUE(menu->GetSubmenu()->IsShowing());
+
+ menu->GetMenuController()->CancelAll();
+
+ Done();
+ }
+};
+
+VIEW_TEST(BookmarkBarViewTest18, SiblingMenu)
« no previous file with comments | « no previous file | views/controls/menu/menu_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698