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

Side by Side Diff: content/renderer/render_view_browsertest.cc

Issue 130773004: Start moving context menu code to RenderFrame. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 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 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/basictypes.h" 5 #include "base/basictypes.h"
6 6
7 #include "base/memory/shared_memory.h" 7 #include "base/memory/shared_memory.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/win/windows_version.h" 10 #include "base/win/windows_version.h"
11 #include "content/common/frame_messages.h"
11 #include "content/common/ssl_status_serialization.h" 12 #include "content/common/ssl_status_serialization.h"
12 #include "content/common/view_messages.h" 13 #include "content/common/view_messages.h"
13 #include "content/public/browser/native_web_keyboard_event.h" 14 #include "content/public/browser/native_web_keyboard_event.h"
14 #include "content/public/browser/web_ui_controller_factory.h" 15 #include "content/public/browser/web_ui_controller_factory.h"
15 #include "content/public/common/bindings_policy.h" 16 #include "content/public/common/bindings_policy.h"
16 #include "content/public/common/page_zoom.h" 17 #include "content/public/common/page_zoom.h"
17 #include "content/public/common/url_constants.h" 18 #include "content/public/common/url_constants.h"
18 #include "content/public/common/url_utils.h" 19 #include "content/public/common/url_utils.h"
19 #include "content/public/renderer/document_state.h" 20 #include "content/public/renderer/document_state.h"
20 #include "content/public/renderer/history_item_serialization.h" 21 #include "content/public/renderer/history_item_serialization.h"
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after
1766 mouse_event.globalX = 250; 1767 mouse_event.globalX = 250;
1767 mouse_event.globalY = 250; 1768 mouse_event.globalY = 250;
1768 1769
1769 SendWebMouseEvent(mouse_event); 1770 SendWebMouseEvent(mouse_event);
1770 1771
1771 // Now simulate the corresponding up event which should display the menu 1772 // Now simulate the corresponding up event which should display the menu
1772 mouse_event.type = WebInputEvent::MouseUp; 1773 mouse_event.type = WebInputEvent::MouseUp;
1773 SendWebMouseEvent(mouse_event); 1774 SendWebMouseEvent(mouse_event);
1774 1775
1775 EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching( 1776 EXPECT_TRUE(render_thread_->sink().GetUniqueMessageMatching(
1776 ViewHostMsg_ContextMenu::ID)); 1777 FrameHostMsg_ContextMenu::ID));
1777 } 1778 }
1778 1779
1779 TEST_F(RenderViewImplTest, TestBackForward) { 1780 TEST_F(RenderViewImplTest, TestBackForward) {
1780 LoadHTML("<div id=pagename>Page A</div>"); 1781 LoadHTML("<div id=pagename>Page A</div>");
1781 blink::WebHistoryItem page_a_item = GetMainFrame()->currentHistoryItem(); 1782 blink::WebHistoryItem page_a_item = GetMainFrame()->currentHistoryItem();
1782 int was_page_a = -1; 1783 int was_page_a = -1;
1783 base::string16 check_page_a = 1784 base::string16 check_page_a =
1784 base::ASCIIToUTF16( 1785 base::ASCIIToUTF16(
1785 "Number(document.getElementById('pagename').innerHTML == 'Page A')"); 1786 "Number(document.getElementById('pagename').innerHTML == 'Page A')");
1786 EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(check_page_a, &was_page_a)); 1787 EXPECT_TRUE(ExecuteJavaScriptAndReturnIntValue(check_page_a, &was_page_a));
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
2234 view()->webview()->clearFocusedNode(); 2235 view()->webview()->clearFocusedNode();
2235 const IPC::Message* msg3 = render_thread_->sink().GetFirstMessageMatching( 2236 const IPC::Message* msg3 = render_thread_->sink().GetFirstMessageMatching(
2236 ViewHostMsg_FocusedNodeChanged::ID); 2237 ViewHostMsg_FocusedNodeChanged::ID);
2237 EXPECT_TRUE(msg3); 2238 EXPECT_TRUE(msg3);
2238 ViewHostMsg_FocusedNodeChanged::Read(msg3, &params); 2239 ViewHostMsg_FocusedNodeChanged::Read(msg3, &params);
2239 EXPECT_FALSE(params.a); 2240 EXPECT_FALSE(params.a);
2240 render_thread_->sink().ClearMessages(); 2241 render_thread_->sink().ClearMessages();
2241 } 2242 }
2242 2243
2243 } // namespace content 2244 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698