| 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)
|
|
|