| OLD | NEW |
| 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/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "ui/views/controls/menu/menu_item_view.h" | 35 #include "ui/views/controls/menu/menu_item_view.h" |
| 36 #include "ui/views/controls/menu/submenu_view.h" | 36 #include "ui/views/controls/menu/submenu_view.h" |
| 37 #include "ui/views/views_delegate.h" | 37 #include "ui/views/views_delegate.h" |
| 38 #include "ui/views/widget/widget.h" | 38 #include "ui/views/widget/widget.h" |
| 39 | 39 |
| 40 using content::BrowserThread; | 40 using content::BrowserThread; |
| 41 using content::OpenURLParams; | 41 using content::OpenURLParams; |
| 42 using content::PageNavigator; | 42 using content::PageNavigator; |
| 43 using content::WebContents; | 43 using content::WebContents; |
| 44 | 44 |
| 45 #if defined(OS_LINUX) | |
| 46 // See http://crbug.com/40040 for details. | |
| 47 #define MAYBE_DND DISABLED_DND | |
| 48 #define MAYBE_DNDToDifferentMenu DISABLED_DNDToDifferentMenu | |
| 49 #define MAYBE_DNDBackToOriginatingMenu DISABLED_DNDBackToOriginatingMenu | |
| 50 | |
| 51 // See http://crbug.com/40039 for details. | |
| 52 #define MAYBE_KeyEvents DISABLED_KeyEvents | |
| 53 | |
| 54 // Two bugs here. http://crbug.com/47089 for general Linux Views, and | |
| 55 // http://crbug.com/47452 for ChromiumOS. | |
| 56 #define MAYBE_CloseWithModalDialog DISABLED_CloseWithModalDialog | |
| 57 // See http://crbug.com/47089 for details. | |
| 58 #define MAYBE_CloseMenuAfterClosingContextMenu \ | |
| 59 DISABLED_CloseMenuAfterClosingContextMenu | |
| 60 | |
| 61 // See bug http://crbug.com/60444 for details. | |
| 62 #define MAYBE_ScrollButtonScrolls DISABLED_ScrollButtonScrolls | |
| 63 #else | |
| 64 | |
| 65 #define MAYBE_DND DND | |
| 66 #define MAYBE_DNDToDifferentMenu DNDToDifferentMenu | |
| 67 #define MAYBE_DNDBackToOriginatingMenu DNDBackToOriginatingMenu | |
| 68 #define MAYBE_DNDBackToOriginatingMenu DNDBackToOriginatingMenu | |
| 69 #define MAYBE_KeyEvents KeyEvents | |
| 70 #define MAYBE_CloseWithModalDialog CloseWithModalDialog | |
| 71 #define MAYBE_CloseMenuAfterClosingContextMenu CloseMenuAfterClosingContextMenu | |
| 72 #define MAYBE_ScrollButtonScrolls ScrollButtonScrolls | |
| 73 | |
| 74 #endif | |
| 75 | |
| 76 namespace { | 45 namespace { |
| 77 | 46 |
| 78 void MoveMouseAndPress(const gfx::Point& screen_pos, | 47 void MoveMouseAndPress(const gfx::Point& screen_pos, |
| 79 ui_controls::MouseButton button, | 48 ui_controls::MouseButton button, |
| 80 int state, | 49 int state, |
| 81 const base::Closure& closure) { | 50 const base::Closure& closure) { |
| 82 ui_controls::SendMouseMove(screen_pos.x(), screen_pos.y()); | 51 ui_controls::SendMouseMove(screen_pos.x(), screen_pos.y()); |
| 83 ui_controls::SendMouseEventsNotifyWhenDone(button, state, closure); | 52 ui_controls::SendMouseEventsNotifyWhenDone(button, state, closure); |
| 84 } | 53 } |
| 85 | 54 |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 | 614 |
| 646 void Step5() { | 615 void Step5() { |
| 647 GURL url = model_->bookmark_bar_node()->GetChild(0)->GetChild(1)->url(); | 616 GURL url = model_->bookmark_bar_node()->GetChild(0)->GetChild(1)->url(); |
| 648 EXPECT_EQ(url_dragging_, url); | 617 EXPECT_EQ(url_dragging_, url); |
| 649 Done(); | 618 Done(); |
| 650 } | 619 } |
| 651 | 620 |
| 652 GURL url_dragging_; | 621 GURL url_dragging_; |
| 653 }; | 622 }; |
| 654 | 623 |
| 655 VIEW_TEST(BookmarkBarViewTest5, MAYBE_DND) | 624 VIEW_TEST(BookmarkBarViewTest5, DND) |
| 656 | 625 |
| 657 // Tests holding mouse down on overflow button, dragging such that menu pops up | 626 // Tests holding mouse down on overflow button, dragging such that menu pops up |
| 658 // then selecting an item. | 627 // then selecting an item. |
| 659 class BookmarkBarViewTest6 : public BookmarkBarViewEventTestBase { | 628 class BookmarkBarViewTest6 : public BookmarkBarViewEventTestBase { |
| 660 protected: | 629 protected: |
| 661 virtual void DoTestOnMessageLoop() { | 630 virtual void DoTestOnMessageLoop() { |
| 662 // Press the mouse button on the overflow button. Don't release it though. | 631 // Press the mouse button on the overflow button. Don't release it though. |
| 663 views::TextButton* button = bb_view_->overflow_button(); | 632 views::TextButton* button = bb_view_->overflow_button(); |
| 664 ui_test_utils::MoveMouseToCenterAndPress(button, ui_controls::LEFT, | 633 ui_test_utils::MoveMouseToCenterAndPress(button, ui_controls::LEFT, |
| 665 ui_controls::DOWN, CreateEventTask(this, &BookmarkBarViewTest6::Step2)); | 634 ui_controls::DOWN, CreateEventTask(this, &BookmarkBarViewTest6::Step2)); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 CreateEventTask(this, &BookmarkBarViewTest7::Step3)); | 693 CreateEventTask(this, &BookmarkBarViewTest7::Step3)); |
| 725 } | 694 } |
| 726 | 695 |
| 727 void Step3() { | 696 void Step3() { |
| 728 // Drag over other button. | 697 // Drag over other button. |
| 729 views::TextButton* other_button = | 698 views::TextButton* other_button = |
| 730 bb_view_->other_bookmarked_button(); | 699 bb_view_->other_bookmarked_button(); |
| 731 gfx::Point loc(other_button->width() / 2, other_button->height() / 2); | 700 gfx::Point loc(other_button->width() / 2, other_button->height() / 2); |
| 732 views::View::ConvertPointToScreen(other_button, &loc); | 701 views::View::ConvertPointToScreen(other_button, &loc); |
| 733 | 702 |
| 703 #if defined(USE_AURA) |
| 704 // TODO: fix this. Aura requires an additional mouse event to trigger drag |
| 705 // and drop checking state. |
| 706 ui_controls::SendMouseMoveNotifyWhenDone(loc.x() + 10, loc.y(), |
| 707 base::Bind(&BookmarkBarViewTest7::Step3A, this)); |
| 708 #else |
| 734 // Start a drag. | 709 // Start a drag. |
| 735 ui_controls::SendMouseMoveNotifyWhenDone(loc.x() + 10, loc.y(), | 710 ui_controls::SendMouseMoveNotifyWhenDone(loc.x() + 10, loc.y(), |
| 736 base::Bind(&BookmarkBarViewTest7::Step4, this)); | 711 base::Bind(&BookmarkBarViewTest7::Step4, this)); |
| 737 | 712 |
| 738 // See comment above this method as to why we do this. | 713 // See comment above this method as to why we do this. |
| 739 ScheduleMouseMoveInBackground(loc.x(), loc.y()); | 714 ScheduleMouseMoveInBackground(loc.x(), loc.y()); |
| 715 #endif |
| 716 } |
| 717 |
| 718 void Step3A() { |
| 719 // Drag over other button. |
| 720 views::TextButton* other_button = |
| 721 bb_view_->other_bookmarked_button(); |
| 722 gfx::Point loc(other_button->width() / 2, other_button->height() / 2); |
| 723 views::View::ConvertPointToScreen(other_button, &loc); |
| 724 |
| 725 ui_controls::SendMouseMoveNotifyWhenDone(loc.x(), loc.y(), |
| 726 base::Bind(&BookmarkBarViewTest7::Step4, this)); |
| 740 } | 727 } |
| 741 | 728 |
| 742 void Step4() { | 729 void Step4() { |
| 743 views::MenuItemView* drop_menu = bb_view_->GetDropMenu(); | 730 views::MenuItemView* drop_menu = bb_view_->GetDropMenu(); |
| 744 ASSERT_TRUE(drop_menu != NULL); | 731 ASSERT_TRUE(drop_menu != NULL); |
| 745 ASSERT_TRUE(drop_menu->GetSubmenu()->IsShowing()); | 732 ASSERT_TRUE(drop_menu->GetSubmenu()->IsShowing()); |
| 746 | 733 |
| 747 views::MenuItemView* target_menu = | 734 views::MenuItemView* target_menu = |
| 748 drop_menu->GetSubmenu()->GetMenuItemAt(0); | 735 drop_menu->GetSubmenu()->GetMenuItemAt(0); |
| 749 gfx::Point loc(1, 1); | 736 gfx::Point loc(1, 1); |
| 750 views::View::ConvertPointToScreen(target_menu, &loc); | 737 views::View::ConvertPointToScreen(target_menu, &loc); |
| 751 ui_controls::SendMouseMove(loc.x(), loc.y()); | 738 ui_controls::SendMouseMove(loc.x(), loc.y()); |
| 752 ui_controls::SendMouseEventsNotifyWhenDone( | 739 ui_controls::SendMouseEventsNotifyWhenDone( |
| 753 ui_controls::LEFT, ui_controls::UP, | 740 ui_controls::LEFT, ui_controls::UP, |
| 754 CreateEventTask(this, &BookmarkBarViewTest7::Step5)); | 741 CreateEventTask(this, &BookmarkBarViewTest7::Step5)); |
| 755 } | 742 } |
| 756 | 743 |
| 757 void Step5() { | 744 void Step5() { |
| 758 ASSERT_TRUE(model_->other_node()->GetChild(0)->url() == url_dragging_); | 745 ASSERT_TRUE(model_->other_node()->GetChild(0)->url() == url_dragging_); |
| 759 Done(); | 746 Done(); |
| 760 } | 747 } |
| 761 | 748 |
| 762 GURL url_dragging_; | 749 GURL url_dragging_; |
| 763 }; | 750 }; |
| 764 | 751 |
| 765 VIEW_TEST(BookmarkBarViewTest7, MAYBE_DNDToDifferentMenu) | 752 VIEW_TEST(BookmarkBarViewTest7, DNDToDifferentMenu) |
| 766 | 753 |
| 767 // Drags from one menu to next so that original menu closes, then back to | 754 // Drags from one menu to next so that original menu closes, then back to |
| 768 // original menu. | 755 // original menu. |
| 769 class BookmarkBarViewTest8 : public BookmarkBarViewEventTestBase { | 756 class BookmarkBarViewTest8 : public BookmarkBarViewEventTestBase { |
| 770 protected: | 757 protected: |
| 771 virtual void DoTestOnMessageLoop() { | 758 virtual void DoTestOnMessageLoop() { |
| 772 url_dragging_ = | 759 url_dragging_ = |
| 773 model_->bookmark_bar_node()->GetChild(0)->GetChild(0)->url(); | 760 model_->bookmark_bar_node()->GetChild(0)->GetChild(0)->url(); |
| 774 | 761 |
| 775 // Move the mouse to the first folder on the bookmark bar and press the | 762 // Move the mouse to the first folder on the bookmark bar and press the |
| (...skipping 22 matching lines...) Expand all Loading... |
| 798 } | 785 } |
| 799 | 786 |
| 800 void Step3() { | 787 void Step3() { |
| 801 // Drag over other button. | 788 // Drag over other button. |
| 802 views::TextButton* other_button = | 789 views::TextButton* other_button = |
| 803 bb_view_->other_bookmarked_button(); | 790 bb_view_->other_bookmarked_button(); |
| 804 gfx::Point loc(other_button->width() / 2, other_button->height() / 2); | 791 gfx::Point loc(other_button->width() / 2, other_button->height() / 2); |
| 805 views::View::ConvertPointToScreen(other_button, &loc); | 792 views::View::ConvertPointToScreen(other_button, &loc); |
| 806 | 793 |
| 807 // Start a drag. | 794 // Start a drag. |
| 795 #if defined(USE_AURA) |
| 796 // TODO: fix this. Aura requires an additional mouse event to trigger drag |
| 797 // and drop checking state. |
| 798 ui_controls::SendMouseMoveNotifyWhenDone(loc.x() + 10, loc.y(), |
| 799 base::Bind(&BookmarkBarViewTest8::Step3A, this)); |
| 800 #else |
| 808 ui_controls::SendMouseMoveNotifyWhenDone(loc.x() + 10, loc.y(), | 801 ui_controls::SendMouseMoveNotifyWhenDone(loc.x() + 10, loc.y(), |
| 809 base::Bind(&BookmarkBarViewTest8::Step4, this)); | 802 base::Bind(&BookmarkBarViewTest8::Step4, this)); |
| 810 | |
| 811 // See comment above this method as to why we do this. | 803 // See comment above this method as to why we do this. |
| 812 ScheduleMouseMoveInBackground(loc.x(), loc.y()); | 804 ScheduleMouseMoveInBackground(loc.x(), loc.y()); |
| 805 #endif |
| 806 } |
| 807 |
| 808 void Step3A() { |
| 809 // Drag over other button. |
| 810 views::TextButton* other_button = |
| 811 bb_view_->other_bookmarked_button(); |
| 812 gfx::Point loc(other_button->width() / 2, other_button->height() / 2); |
| 813 views::View::ConvertPointToScreen(other_button, &loc); |
| 814 |
| 815 ui_controls::SendMouseMoveNotifyWhenDone(loc.x() + 10, loc.y(), |
| 816 base::Bind(&BookmarkBarViewTest8::Step4, this)); |
| 813 } | 817 } |
| 814 | 818 |
| 815 void Step4() { | 819 void Step4() { |
| 816 views::MenuItemView* drop_menu = bb_view_->GetDropMenu(); | 820 views::MenuItemView* drop_menu = bb_view_->GetDropMenu(); |
| 817 ASSERT_TRUE(drop_menu != NULL); | 821 ASSERT_TRUE(drop_menu != NULL); |
| 818 ASSERT_TRUE(drop_menu->GetSubmenu()->IsShowing()); | 822 ASSERT_TRUE(drop_menu->GetSubmenu()->IsShowing()); |
| 819 | 823 |
| 820 // Now drag back over first menu. | 824 // Now drag back over first menu. |
| 821 views::TextButton* button = GetBookmarkButton(0); | 825 views::TextButton* button = GetBookmarkButton(0); |
| 822 gfx::Point loc(button->width() / 2, button->height() / 2); | 826 gfx::Point loc(button->width() / 2, button->height() / 2); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 842 // Make sure drop was processed. | 846 // Make sure drop was processed. |
| 843 GURL final_url = model_->bookmark_bar_node()->GetChild(0)->GetChild(0)-> | 847 GURL final_url = model_->bookmark_bar_node()->GetChild(0)->GetChild(0)-> |
| 844 GetChild(1)->url(); | 848 GetChild(1)->url(); |
| 845 ASSERT_TRUE(final_url == url_dragging_); | 849 ASSERT_TRUE(final_url == url_dragging_); |
| 846 Done(); | 850 Done(); |
| 847 } | 851 } |
| 848 | 852 |
| 849 GURL url_dragging_; | 853 GURL url_dragging_; |
| 850 }; | 854 }; |
| 851 | 855 |
| 852 VIEW_TEST(BookmarkBarViewTest8, MAYBE_DNDBackToOriginatingMenu) | 856 VIEW_TEST(BookmarkBarViewTest8, DNDBackToOriginatingMenu) |
| 853 | 857 |
| 854 // Moves the mouse over the scroll button and makes sure we get scrolling. | 858 // Moves the mouse over the scroll button and makes sure we get scrolling. |
| 855 class BookmarkBarViewTest9 : public BookmarkBarViewEventTestBase { | 859 class BookmarkBarViewTest9 : public BookmarkBarViewEventTestBase { |
| 856 protected: | 860 protected: |
| 857 virtual bool CreateBigMenu() { return true; } | 861 virtual bool CreateBigMenu() { return true; } |
| 858 | 862 |
| 859 virtual void DoTestOnMessageLoop() { | 863 virtual void DoTestOnMessageLoop() { |
| 860 // Move the mouse to the first folder on the bookmark bar and press the | 864 // Move the mouse to the first folder on the bookmark bar and press the |
| 861 // mouse. | 865 // mouse. |
| 862 views::TextButton* button = GetBookmarkButton(0); | 866 views::TextButton* button = GetBookmarkButton(0); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 // next execution loop. | 917 // next execution loop. |
| 914 MessageLoop::current()->PostTask( | 918 MessageLoop::current()->PostTask( |
| 915 FROM_HERE, | 919 FROM_HERE, |
| 916 base::Bind(&ViewEventTestBase::Done, this)); | 920 base::Bind(&ViewEventTestBase::Done, this)); |
| 917 } | 921 } |
| 918 | 922 |
| 919 int start_y_; | 923 int start_y_; |
| 920 views::MenuItemView* first_menu_; | 924 views::MenuItemView* first_menu_; |
| 921 }; | 925 }; |
| 922 | 926 |
| 923 VIEW_TEST(BookmarkBarViewTest9, MAYBE_ScrollButtonScrolls) | 927 VIEW_TEST(BookmarkBarViewTest9, ScrollButtonScrolls) |
| 924 | 928 |
| 925 // Tests up/down/left/enter key messages. | 929 // Tests up/down/left/enter key messages. |
| 926 class BookmarkBarViewTest10 : public BookmarkBarViewEventTestBase { | 930 class BookmarkBarViewTest10 : public BookmarkBarViewEventTestBase { |
| 927 protected: | 931 protected: |
| 928 virtual void DoTestOnMessageLoop() { | 932 virtual void DoTestOnMessageLoop() { |
| 929 // Move the mouse to the first folder on the bookmark bar and press the | 933 // Move the mouse to the first folder on the bookmark bar and press the |
| 930 // mouse. | 934 // mouse. |
| 931 views::TextButton* button = GetBookmarkButton(0); | 935 views::TextButton* button = GetBookmarkButton(0); |
| 932 ui_test_utils::MoveMouseToCenterAndPress(button, ui_controls::LEFT, | 936 ui_test_utils::MoveMouseToCenterAndPress(button, ui_controls::LEFT, |
| 933 ui_controls::DOWN | ui_controls::UP, | 937 ui_controls::DOWN | ui_controls::UP, |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 } | 1023 } |
| 1020 | 1024 |
| 1021 void Step8() { | 1025 void Step8() { |
| 1022 ASSERT_TRUE( | 1026 ASSERT_TRUE( |
| 1023 model_->bookmark_bar_node()->GetChild(0)->GetChild(0)->url() == | 1027 model_->bookmark_bar_node()->GetChild(0)->GetChild(0)->url() == |
| 1024 navigator_.url_); | 1028 navigator_.url_); |
| 1025 Done(); | 1029 Done(); |
| 1026 } | 1030 } |
| 1027 }; | 1031 }; |
| 1028 | 1032 |
| 1029 VIEW_TEST(BookmarkBarViewTest10, MAYBE_KeyEvents) | 1033 VIEW_TEST(BookmarkBarViewTest10, KeyEvents) |
| 1030 | 1034 |
| 1031 // Make sure the menu closes with the following sequence: show menu, show | 1035 // Make sure the menu closes with the following sequence: show menu, show |
| 1032 // context menu, close context menu (via escape), then click else where. This | 1036 // context menu, close context menu (via escape), then click else where. This |
| 1033 // effectively verifies we maintain mouse capture after the context menu is | 1037 // effectively verifies we maintain mouse capture after the context menu is |
| 1034 // hidden. | 1038 // hidden. |
| 1035 class BookmarkBarViewTest11 : public BookmarkBarViewEventTestBase { | 1039 class BookmarkBarViewTest11 : public BookmarkBarViewEventTestBase { |
| 1036 public: | 1040 public: |
| 1037 BookmarkBarViewTest11() | 1041 BookmarkBarViewTest11() |
| 1038 : ALLOW_THIS_IN_INITIALIZER_LIST( | 1042 : ALLOW_THIS_IN_INITIALIZER_LIST( |
| 1039 observer_(CreateEventTask(this, &BookmarkBarViewTest11::Step3))) { | 1043 observer_(CreateEventTask(this, &BookmarkBarViewTest11::Step3))) { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1096 // Make sure the menu is not showing. | 1100 // Make sure the menu is not showing. |
| 1097 views::MenuItemView* menu = bb_view_->GetMenu(); | 1101 views::MenuItemView* menu = bb_view_->GetMenu(); |
| 1098 ASSERT_TRUE(!menu || !menu->GetSubmenu() || | 1102 ASSERT_TRUE(!menu || !menu->GetSubmenu() || |
| 1099 !menu->GetSubmenu()->IsShowing()); | 1103 !menu->GetSubmenu()->IsShowing()); |
| 1100 Done(); | 1104 Done(); |
| 1101 } | 1105 } |
| 1102 | 1106 |
| 1103 ContextMenuNotificationObserver observer_; | 1107 ContextMenuNotificationObserver observer_; |
| 1104 }; | 1108 }; |
| 1105 | 1109 |
| 1106 VIEW_TEST(BookmarkBarViewTest11, MAYBE_CloseMenuAfterClosingContextMenu) | 1110 VIEW_TEST(BookmarkBarViewTest11, CloseMenuAfterClosingContextMenu) |
| 1107 | 1111 |
| 1108 // Tests showing a modal dialog from a context menu. | 1112 // Tests showing a modal dialog from a context menu. |
| 1109 class BookmarkBarViewTest12 : public BookmarkBarViewEventTestBase { | 1113 class BookmarkBarViewTest12 : public BookmarkBarViewEventTestBase { |
| 1110 protected: | 1114 protected: |
| 1111 virtual void DoTestOnMessageLoop() { | 1115 virtual void DoTestOnMessageLoop() { |
| 1112 // Open up the other folder. | 1116 // Open up the other folder. |
| 1113 views::TextButton* button = bb_view_->other_bookmarked_button(); | 1117 views::TextButton* button = bb_view_->other_bookmarked_button(); |
| 1114 ui_test_utils::MoveMouseToCenterAndPress(button, ui_controls::LEFT, | 1118 ui_test_utils::MoveMouseToCenterAndPress(button, ui_controls::LEFT, |
| 1115 ui_controls::DOWN | ui_controls::UP, | 1119 ui_controls::DOWN | ui_controls::UP, |
| 1116 CreateEventTask(this, &BookmarkBarViewTest12::Step2)); | 1120 CreateEventTask(this, &BookmarkBarViewTest12::Step2)); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1178 // Do a delayed task to give the dialog time to exit. | 1182 // Do a delayed task to give the dialog time to exit. |
| 1179 MessageLoop::current()->PostTask( | 1183 MessageLoop::current()->PostTask( |
| 1180 FROM_HERE, CreateEventTask(this, &BookmarkBarViewTest12::Step7)); | 1184 FROM_HERE, CreateEventTask(this, &BookmarkBarViewTest12::Step7)); |
| 1181 } | 1185 } |
| 1182 | 1186 |
| 1183 void Step7() { | 1187 void Step7() { |
| 1184 Done(); | 1188 Done(); |
| 1185 } | 1189 } |
| 1186 }; | 1190 }; |
| 1187 | 1191 |
| 1188 VIEW_TEST(BookmarkBarViewTest12, MAYBE_CloseWithModalDialog) | 1192 VIEW_TEST(BookmarkBarViewTest12, CloseWithModalDialog) |
| 1189 | 1193 |
| 1190 // Tests clicking on the separator of a context menu (this is for coverage of | 1194 // Tests clicking on the separator of a context menu (this is for coverage of |
| 1191 // bug 17862). | 1195 // bug 17862). |
| 1192 class BookmarkBarViewTest13 : public BookmarkBarViewEventTestBase { | 1196 class BookmarkBarViewTest13 : public BookmarkBarViewEventTestBase { |
| 1193 public: | 1197 public: |
| 1194 BookmarkBarViewTest13() | 1198 BookmarkBarViewTest13() |
| 1195 : ALLOW_THIS_IN_INITIALIZER_LIST( | 1199 : ALLOW_THIS_IN_INITIALIZER_LIST( |
| 1196 observer_(CreateEventTask(this, &BookmarkBarViewTest13::Step3))) { | 1200 observer_(CreateEventTask(this, &BookmarkBarViewTest13::Step3))) { |
| 1197 } | 1201 } |
| 1198 | 1202 |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1618 ASSERT_TRUE(menu != NULL); | 1622 ASSERT_TRUE(menu != NULL); |
| 1619 ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); | 1623 ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); |
| 1620 | 1624 |
| 1621 menu->GetMenuController()->CancelAll(); | 1625 menu->GetMenuController()->CancelAll(); |
| 1622 | 1626 |
| 1623 Done(); | 1627 Done(); |
| 1624 } | 1628 } |
| 1625 }; | 1629 }; |
| 1626 | 1630 |
| 1627 VIEW_TEST(BookmarkBarViewTest19, SiblingMenu) | 1631 VIEW_TEST(BookmarkBarViewTest19, SiblingMenu) |
| OLD | NEW |