| 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 6016fd53d2972f53e58b8a4f5a5c1973d403672b..b2aca2c00964199b7b874f927c87757482be8f36 100644
|
| --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
|
| +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc
|
| @@ -1188,14 +1188,7 @@ class BookmarkBarViewTest12 : public BookmarkBarViewEventTestBase {
|
| }
|
| };
|
|
|
| -#if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA)
|
| -// TODO(erg): linux_aura bringup: http://crbug.com/163931
|
| -#define MAYBE_CloseWithModalDialog DISABLED_CloseWithModalDialog
|
| -#else
|
| -#define MAYBE_CloseWithModalDialog CloseWithModalDialog
|
| -#endif
|
| -
|
| -VIEW_TEST(BookmarkBarViewTest12, MAYBE_CloseWithModalDialog)
|
| +VIEW_TEST(BookmarkBarViewTest12, CloseWithModalDialog)
|
|
|
| // Tests clicking on the separator of a context menu (this is for coverage of
|
| // bug 17862).
|
| @@ -1838,3 +1831,87 @@ class BookmarkBarViewTest21 : public BookmarkBarViewEventTestBase {
|
| };
|
|
|
| VIEW_TEST(BookmarkBarViewTest21, ContextMenusForEmptyFolder)
|
| +
|
| +class BookmarkBarViewTest12_Step2 : public BookmarkBarViewEventTestBase {
|
| + protected:
|
| + virtual void DoTestOnMessageLoop() OVERRIDE {
|
| + // Open up the other folder.
|
| + views::TextButton* button = bb_view_->other_bookmarked_button();
|
| + ui_test_utils::MoveMouseToCenterAndPress(button, ui_controls::LEFT,
|
| + ui_controls::DOWN | ui_controls::UP,
|
| + CreateEventTask(this, &BookmarkBarViewTest12_Step2::Step2));
|
| + chrome::num_bookmark_urls_before_prompting = 1;
|
| + }
|
| +
|
| + virtual ~BookmarkBarViewTest12_Step2() {
|
| + chrome::num_bookmark_urls_before_prompting = 15;
|
| + }
|
| +
|
| + private:
|
| + void Step2() {
|
| + // Menu should be showing.
|
| + views::MenuItemView* menu = bb_view_->GetMenu();
|
| + ASSERT_TRUE(menu != NULL);
|
| + ASSERT_TRUE(menu->GetSubmenu()->IsShowing());
|
| +
|
| + views::MenuItemView* child_menu =
|
| + menu->GetSubmenu()->GetMenuItemAt(1);
|
| + ASSERT_TRUE(child_menu != NULL);
|
| + menu->GetMenuController()->CancelAll();
|
| + Done();
|
| + }
|
| +};
|
| +
|
| +VIEW_TEST(BookmarkBarViewTest12_Step2, CloseWithModalDialog)
|
| +
|
| +class BookmarkBarViewTest12_Step3 : public BookmarkBarViewEventTestBase {
|
| + protected:
|
| + virtual void DoTestOnMessageLoop() OVERRIDE {
|
| + // Open up the other folder.
|
| + views::TextButton* button = bb_view_->other_bookmarked_button();
|
| + ui_test_utils::MoveMouseToCenterAndPress(button, ui_controls::LEFT,
|
| + ui_controls::DOWN | ui_controls::UP,
|
| + CreateEventTask(this, &BookmarkBarViewTest12_Step3::Step2));
|
| + chrome::num_bookmark_urls_before_prompting = 1;
|
| + }
|
| +
|
| + virtual ~BookmarkBarViewTest12_Step3() {
|
| + chrome::num_bookmark_urls_before_prompting = 15;
|
| + }
|
| +
|
| + private:
|
| + void Step2() {
|
| + // Menu should be showing.
|
| + views::MenuItemView* menu = bb_view_->GetMenu();
|
| + ASSERT_TRUE(menu != NULL);
|
| + ASSERT_TRUE(menu->GetSubmenu()->IsShowing());
|
| +
|
| + views::MenuItemView* child_menu =
|
| + menu->GetSubmenu()->GetMenuItemAt(1);
|
| + ASSERT_TRUE(child_menu != NULL);
|
| +
|
| + // Right click on the second child (a folder) to get its context menu.
|
| + ui_test_utils::MoveMouseToCenterAndPress(child_menu, ui_controls::RIGHT,
|
| + ui_controls::DOWN | ui_controls::UP,
|
| + CreateEventTask(this, &BookmarkBarViewTest12_Step3::Step3));
|
| + }
|
| +
|
| + void Step3() {
|
| + // Make sure the context menu is showing.
|
| + views::MenuItemView* menu = bb_view_->GetContextMenu();
|
| + ASSERT_TRUE(menu && menu->GetSubmenu() && menu->GetSubmenu()->IsShowing());
|
| +
|
| + // Select the first item in the context menu (open all).
|
| + views::MenuItemView* child_menu =
|
| + menu->GetSubmenu()->GetMenuItemAt(0);
|
| + ASSERT_TRUE(child_menu != NULL);
|
| + ui_test_utils::MoveMouseToCenterAndPress(child_menu, ui_controls::LEFT,
|
| + ui_controls::DOWN | ui_controls::UP, base::Closure());
|
| +
|
| + menu->GetMenuController()->CancelAll();
|
| + bb_view_->GetMenu()->GetMenuController()->CancelAll();
|
| + Done();
|
| + }
|
| +};
|
| +
|
| +VIEW_TEST(BookmarkBarViewTest12_Step3, CloseWithModalDialog)
|
|
|