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

Side by Side Diff: chrome/browser/ui/views/menu_item_view_test.cc

Issue 16979002: Add ContextMenuSourceType to views::ContextMenuController::ShowContextMenuForView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 years, 6 months 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 | Annotate | Revision Log
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/callback.h" 5 #include "base/callback.h"
6 #include "base/strings/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "chrome/test/base/interactive_test_utils.h" 7 #include "chrome/test/base/interactive_test_utils.h"
8 #include "chrome/test/base/ui_test_utils.h" 8 #include "chrome/test/base/ui_test_utils.h"
9 #include "chrome/test/base/view_event_test_base.h" 9 #include "chrome/test/base/view_event_test_base.h"
10 #include "ui/base/test/ui_controls.h" 10 #include "ui/base/test/ui_controls.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 virtual void OnMenuButtonClicked(views::View* source, 74 virtual void OnMenuButtonClicked(views::View* source,
75 const gfx::Point& point) OVERRIDE { 75 const gfx::Point& point) OVERRIDE {
76 gfx::Point screen_location; 76 gfx::Point screen_location;
77 views::View::ConvertPointToScreen(source, &screen_location); 77 views::View::ConvertPointToScreen(source, &screen_location);
78 gfx::Rect bounds(screen_location, source->size()); 78 gfx::Rect bounds(screen_location, source->size());
79 ignore_result(menu_runner_->RunMenuAt( 79 ignore_result(menu_runner_->RunMenuAt(
80 source->GetWidget(), 80 source->GetWidget(),
81 button_, 81 button_,
82 bounds, 82 bounds,
83 views::MenuItemView::TOPLEFT, 83 views::MenuItemView::TOPLEFT,
84 ui::MENU_SOURCE_NONE,
84 views::MenuRunner::HAS_MNEMONICS)); 85 views::MenuRunner::HAS_MNEMONICS));
85 } 86 }
86 87
87 protected: 88 protected:
88 // Generate a mouse click on the specified view and post a new task. 89 // Generate a mouse click on the specified view and post a new task.
89 virtual void Click(views::View* view, const base::Closure& next) { 90 virtual void Click(views::View* view, const base::Closure& next) {
90 ui_test_utils::MoveMouseToCenterAndPress( 91 ui_test_utils::MoveMouseToCenterAndPress(
91 view, 92 view,
92 ui_controls::LEFT, 93 ui_controls::LEFT,
93 ui_controls::DOWN | ui_controls::UP, 94 ui_controls::DOWN | ui_controls::UP,
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 typedef MenuItemViewTestRemoveWithSubmenu<1> MenuItemViewTestRemoveWithSubmenu1; 539 typedef MenuItemViewTestRemoveWithSubmenu<1> MenuItemViewTestRemoveWithSubmenu1;
539 #if defined(OS_WIN) 540 #if defined(OS_WIN)
540 #define MAYBE_RemoveItemWithSubmenu0 DISABLED_RemoveItemWithSubmenu0 541 #define MAYBE_RemoveItemWithSubmenu0 DISABLED_RemoveItemWithSubmenu0
541 #define MAYBE_RemoveItemWithSubmenu1 DISABLED_RemoveItemWithSubmenu1 542 #define MAYBE_RemoveItemWithSubmenu1 DISABLED_RemoveItemWithSubmenu1
542 #else 543 #else
543 #define MAYBE_RemoveItemWithSubmenu0 RemoveItemWithSubmenu0 544 #define MAYBE_RemoveItemWithSubmenu0 RemoveItemWithSubmenu0
544 #define MAYBE_RemoveItemWithSubmenu1 RemoveItemWithSubmenu1 545 #define MAYBE_RemoveItemWithSubmenu1 RemoveItemWithSubmenu1
545 #endif 546 #endif
546 VIEW_TEST(MenuItemViewTestRemoveWithSubmenu0, MAYBE_RemoveItemWithSubmenu0) 547 VIEW_TEST(MenuItemViewTestRemoveWithSubmenu0, MAYBE_RemoveItemWithSubmenu0)
547 VIEW_TEST(MenuItemViewTestRemoveWithSubmenu1, MAYBE_RemoveItemWithSubmenu1) 548 VIEW_TEST(MenuItemViewTestRemoveWithSubmenu1, MAYBE_RemoveItemWithSubmenu1)
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/page_action_image_view.cc ('k') | chrome/browser/ui/views/menu_model_adapter_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698