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

Unified Diff: content/renderer/render_view_browsertest.cc

Issue 9382037: Move ContextMenuParams struct from webkit/glue to content/public/common. The reasons are: (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/render_view_browsertest.cc
===================================================================
--- content/renderer/render_view_browsertest.cc (revision 121660)
+++ content/renderer/render_view_browsertest.cc (working copy)
@@ -24,6 +24,8 @@
#include "webkit/glue/web_io_operators.h"
using WebKit::WebFrame;
+using WebKit::WebInputEvent;
+using WebKit::WebMouseEvent;
using WebKit::WebString;
using WebKit::WebTextDirection;
using WebKit::WebURLError;
@@ -1145,3 +1147,26 @@
EXPECT_EQ(ASCIIToUTF16("t"), type);
EXPECT_EQ(ASCIIToUTF16("title"), title);
}
+
+TEST_F(RenderViewImplTest, ContextMenu) {
+ LoadHTML("<div>Page A</div>");
+
+ // Create a right click in the center of the iframe. (I'm hoping this will
+ // make this a bit more robust in case of some other formatting or other bug.)
+ WebMouseEvent mouse_event;
+ mouse_event.type = WebInputEvent::MouseDown;
+ mouse_event.button = WebMouseEvent::ButtonRight;
+ mouse_event.x = 250;
+ mouse_event.y = 250;
+ mouse_event.globalX = 250;
+ mouse_event.globalY = 250;
+
+ SendWebMouseEvent(mouse_event);
+
+ // Now simulate the corresponding up event which should display the menu
+ mouse_event.type = WebInputEvent::MouseUp;
+ SendWebMouseEvent(mouse_event);
+
+ EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching(
+ ViewHostMsg_ContextMenu::ID));
+}

Powered by Google App Engine
This is Rietveld 408576698