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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc

Issue 1495973002: [Views] If a sibling menu is selected, reset the MenuButton's PressedLock (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test fix Created 5 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after
1709 ui_controls::DOWN | ui_controls::UP, 1709 ui_controls::DOWN | ui_controls::UP,
1710 CreateEventTask(this, &BookmarkBarViewTest18::Step2)); 1710 CreateEventTask(this, &BookmarkBarViewTest18::Step2));
1711 } 1711 }
1712 1712
1713 private: 1713 private:
1714 void Step2() { 1714 void Step2() {
1715 // Menu should be showing. 1715 // Menu should be showing.
1716 views::MenuItemView* menu = bb_view_->GetMenu(); 1716 views::MenuItemView* menu = bb_view_->GetMenu();
1717 ASSERT_TRUE(menu != NULL); 1717 ASSERT_TRUE(menu != NULL);
1718 ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); 1718 ASSERT_TRUE(menu->GetSubmenu()->IsShowing());
1719 // The button should be pressed.
1720 EXPECT_EQ(views::Button::STATE_PRESSED,
1721 bb_view_->other_bookmarks_button()->state());
1719 1722
1720 // Move the mouse to the first folder on the bookmark bar 1723 // Move the mouse to the first folder on the bookmark bar.
1721 views::LabelButton* button = GetBookmarkButton(0); 1724 views::LabelButton* button = GetBookmarkButton(0);
1722 gfx::Point button_center(button->width() / 2, button->height() / 2); 1725 gfx::Point button_center(button->width() / 2, button->height() / 2);
1723 views::View::ConvertPointToScreen(button, &button_center); 1726 views::View::ConvertPointToScreen(button, &button_center);
1724 ASSERT_TRUE(ui_controls::SendMouseMoveNotifyWhenDone( 1727 ASSERT_TRUE(ui_controls::SendMouseMoveNotifyWhenDone(
1725 button_center.x(), button_center.y(), 1728 button_center.x(), button_center.y(),
1726 CreateEventTask(this, &BookmarkBarViewTest18::Step3))); 1729 CreateEventTask(this, &BookmarkBarViewTest18::Step3)));
1727 } 1730 }
1728 1731
1729 void Step3() { 1732 void Step3() {
1730 // Make sure the menu is showing. 1733 // Make sure the menu is showing.
1731 views::MenuItemView* menu = bb_view_->GetMenu(); 1734 views::MenuItemView* menu = bb_view_->GetMenu();
1732 ASSERT_TRUE(menu != NULL); 1735 ASSERT_TRUE(menu != NULL);
1733 ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); 1736 ASSERT_TRUE(menu->GetSubmenu()->IsShowing());
1734 1737
1735 // The menu for the first folder should be in the pressed state (since the 1738 // The menu for the first folder should be in the pressed state (since the
1736 // menu is showing for it). 1739 // menu is showing for it)...
1737 EXPECT_EQ(views::CustomButton::STATE_PRESSED, 1740 EXPECT_EQ(views::CustomButton::STATE_PRESSED,
1738 GetBookmarkButton(0)->state()); 1741 GetBookmarkButton(0)->state());
1742 // ... And the "other bookmarks" button should no longer be pressed.
1743 EXPECT_EQ(views::Button::STATE_NORMAL,
1744 bb_view_->other_bookmarks_button()->state());
1739 1745
1740 menu->GetMenuController()->CancelAll(); 1746 menu->GetMenuController()->CancelAll();
1741 1747
1742 Done(); 1748 Done();
1743 } 1749 }
1744 }; 1750 };
1745 1751
1746 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 1752 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
1747 // TODO(erg): linux_aura bringup: http://crbug.com/163931 1753 // TODO(erg): linux_aura bringup: http://crbug.com/163931
1748 #define MAYBE_BookmarkBarViewTest18_SiblingMenu \ 1754 #define MAYBE_BookmarkBarViewTest18_SiblingMenu \
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
2228 }; 2234 };
2229 2235
2230 #if defined(USE_OZONE) 2236 #if defined(USE_OZONE)
2231 // ozone bringup - http://crbug.com/401304 2237 // ozone bringup - http://crbug.com/401304
2232 #define MAYBE_ContextMenusKeyboardEscape DISABLED_ContextMenusKeyboardEscape 2238 #define MAYBE_ContextMenusKeyboardEscape DISABLED_ContextMenusKeyboardEscape
2233 #else 2239 #else
2234 #define MAYBE_ContextMenusKeyboardEscape ContextMenusKeyboardEscape 2240 #define MAYBE_ContextMenusKeyboardEscape ContextMenusKeyboardEscape
2235 #endif 2241 #endif
2236 VIEW_TEST(BookmarkBarViewTest24, MAYBE_ContextMenusKeyboardEscape) 2242 VIEW_TEST(BookmarkBarViewTest24, MAYBE_ContextMenusKeyboardEscape)
2237 2243
OLDNEW
« no previous file with comments | « no previous file | ui/views/controls/button/menu_button.cc » ('j') | ui/views/controls/button/menu_button.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698