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" |
11 #include "chrome/browser/tab_contents/page_navigator.h" | 11 #include "chrome/browser/tab_contents/page_navigator.h" |
12 #include "chrome/browser/views/bookmark_bar_view.h" | 12 #include "chrome/browser/views/bookmark_bar_view.h" |
13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
14 #include "chrome/common/pref_service.h" | 14 #include "chrome/common/pref_service.h" |
15 #include "chrome/test/testing_profile.h" | 15 #include "chrome/test/testing_profile.h" |
16 #include "chrome/test/interactive_ui/view_event_test_base.h" | 16 #include "chrome/test/interactive_ui/view_event_test_base.h" |
| 17 #include "views/controls/button/menu_button.h" |
17 #include "views/controls/button/text_button.h" | 18 #include "views/controls/button/text_button.h" |
18 #include "views/controls/menu/menu_controller.h" | 19 #include "views/controls/menu/menu_controller.h" |
19 #include "views/controls/menu/menu_item_view.h" | 20 #include "views/controls/menu/menu_item_view.h" |
20 #include "views/controls/menu/submenu_view.h" | 21 #include "views/controls/menu/submenu_view.h" |
21 #include "views/window/window.h" | 22 #include "views/window/window.h" |
22 | 23 |
23 namespace { | 24 namespace { |
24 | 25 |
25 // PageNavigator implementation that records the URL. | 26 // PageNavigator implementation that records the URL. |
26 class TestingPageNavigator : public PageNavigator { | 27 class TestingPageNavigator : public PageNavigator { |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 273 |
273 VIEW_TEST(BookmarkBarViewTest2, HideOnDesktopClick) | 274 VIEW_TEST(BookmarkBarViewTest2, HideOnDesktopClick) |
274 | 275 |
275 // Brings up menu. Moves over child to make sure submenu appears, moves over | 276 // Brings up menu. Moves over child to make sure submenu appears, moves over |
276 // another child and make sure next menu appears. | 277 // another child and make sure next menu appears. |
277 class BookmarkBarViewTest3 : public BookmarkBarViewEventTestBase { | 278 class BookmarkBarViewTest3 : public BookmarkBarViewEventTestBase { |
278 protected: | 279 protected: |
279 virtual void DoTestOnMessageLoop() { | 280 virtual void DoTestOnMessageLoop() { |
280 // Move the mouse to the first folder on the bookmark bar and press the | 281 // Move the mouse to the first folder on the bookmark bar and press the |
281 // mouse. | 282 // mouse. |
282 views::TextButton* button = bb_view_->other_bookmarked_button(); | 283 views::MenuButton* button = bb_view_->other_bookmarked_button(); |
283 ui_controls::MoveMouseToCenterAndPress(button, ui_controls::LEFT, | 284 ui_controls::MoveMouseToCenterAndPress(button, ui_controls::LEFT, |
284 ui_controls::DOWN | ui_controls::UP, | 285 ui_controls::DOWN | ui_controls::UP, |
285 CreateEventTask(this, &BookmarkBarViewTest3::Step2)); | 286 CreateEventTask(this, &BookmarkBarViewTest3::Step2)); |
286 } | 287 } |
287 | 288 |
288 private: | 289 private: |
289 void Step2() { | 290 void Step2() { |
290 // Menu should be showing. | 291 // Menu should be showing. |
291 views::MenuItemView* menu = bb_view_->GetMenu(); | 292 views::MenuItemView* menu = bb_view_->GetMenu(); |
292 ASSERT_TRUE(menu != NULL); | 293 ASSERT_TRUE(menu != NULL); |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 CreateEventTask(this, &BookmarkBarViewTest13::Step5)); | 1050 CreateEventTask(this, &BookmarkBarViewTest13::Step5)); |
1050 } | 1051 } |
1051 | 1052 |
1052 void Step5() { | 1053 void Step5() { |
1053 DLOG(WARNING) << " DONE"; | 1054 DLOG(WARNING) << " DONE"; |
1054 Done(); | 1055 Done(); |
1055 } | 1056 } |
1056 }; | 1057 }; |
1057 | 1058 |
1058 VIEW_TEST(BookmarkBarViewTest13, ClickOnContextMenuSeparator) | 1059 VIEW_TEST(BookmarkBarViewTest13, ClickOnContextMenuSeparator) |
OLD | NEW |