OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/keyboard_codes.h" | 5 #include "base/keyboard_codes.h" |
6 #include "base/string_util.h" | 6 #include "base/string_util.h" |
7 #include "chrome/browser/automation/ui_controls.h" | 7 #include "chrome/browser/automation/ui_controls.h" |
8 #include "chrome/browser/bookmarks/bookmark_model.h" | 8 #include "chrome/browser/bookmarks/bookmark_model.h" |
9 #include "chrome/browser/bookmarks/bookmark_utils.h" | 9 #include "chrome/browser/bookmarks/bookmark_utils.h" |
10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 CreateEventTask(this, &BookmarkBarViewTest13::Step5)); | 1050 CreateEventTask(this, &BookmarkBarViewTest13::Step5)); |
1051 } | 1051 } |
1052 | 1052 |
1053 void Step5() { | 1053 void Step5() { |
1054 DLOG(WARNING) << " DONE"; | 1054 DLOG(WARNING) << " DONE"; |
1055 Done(); | 1055 Done(); |
1056 } | 1056 } |
1057 }; | 1057 }; |
1058 | 1058 |
1059 VIEW_TEST(BookmarkBarViewTest13, ClickOnContextMenuSeparator) | 1059 VIEW_TEST(BookmarkBarViewTest13, ClickOnContextMenuSeparator) |
| 1060 |
| 1061 // Makes sure right cliking on a folder on the bookmark bar doesn't result in |
| 1062 // both a context menu and showing the menu. |
| 1063 class BookmarkBarViewTest14 : public BookmarkBarViewEventTestBase { |
| 1064 protected: |
| 1065 virtual void DoTestOnMessageLoop() { |
| 1066 // Move the mouse to the first folder on the bookmark bar and press the |
| 1067 // right mouse button. |
| 1068 views::TextButton* button = bb_view_->GetBookmarkButton(0); |
| 1069 ui_controls::MoveMouseToCenterAndPress(button, ui_controls::RIGHT, |
| 1070 ui_controls::DOWN | ui_controls::UP, |
| 1071 CreateEventTask(this, &BookmarkBarViewTest14::Step2)); |
| 1072 } |
| 1073 |
| 1074 private: |
| 1075 void Step2() { |
| 1076 // Menu should NOT be showing. |
| 1077 views::MenuItemView* menu = bb_view_->GetMenu(); |
| 1078 ASSERT_TRUE(menu == NULL); |
| 1079 |
| 1080 // Send escape so that the context menu hides. |
| 1081 ui_controls::SendKeyPressNotifyWhenDone( |
| 1082 NULL, base::VKEY_ESCAPE, false, false, false, |
| 1083 CreateEventTask(this, &BookmarkBarViewTest14::Step3)); |
| 1084 } |
| 1085 |
| 1086 void Step3() { |
| 1087 Done(); |
| 1088 } |
| 1089 }; |
| 1090 |
| 1091 VIEW_TEST(BookmarkBarViewTest14, ContextMenus2) |
OLD | NEW |