| OLD | NEW |
| 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/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
| 6 #include "content/browser/child_process_security_policy_impl.h" | 6 #include "content/browser/child_process_security_policy_impl.h" |
| 7 #include "content/browser/renderer_host/test_render_view_host.h" | 7 #include "content/browser/renderer_host/test_render_view_host.h" |
| 8 #include "content/browser/web_contents/navigation_controller_impl.h" | 8 #include "content/browser/web_contents/navigation_controller_impl.h" |
| 9 #include "content/browser/web_contents/test_web_contents.h" | 9 #include "content/browser/web_contents/test_web_contents.h" |
| 10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 new TestWebContents(browser_context(), rvh()->GetSiteInstance())); | 75 new TestWebContents(browser_context(), rvh()->GetSiteInstance())); |
| 76 | 76 |
| 77 rvh()->AllowBindings(content::BINDINGS_POLICY_WEB_UI); | 77 rvh()->AllowBindings(content::BINDINGS_POLICY_WEB_UI); |
| 78 EXPECT_FALSE(rvh()->GetEnabledBindings() & content::BINDINGS_POLICY_WEB_UI); | 78 EXPECT_FALSE(rvh()->GetEnabledBindings() & content::BINDINGS_POLICY_WEB_UI); |
| 79 } | 79 } |
| 80 | 80 |
| 81 class MockDraggingRenderViewHostDelegateView | 81 class MockDraggingRenderViewHostDelegateView |
| 82 : public content::RenderViewHostDelegateView { | 82 : public content::RenderViewHostDelegateView { |
| 83 public: | 83 public: |
| 84 virtual ~MockDraggingRenderViewHostDelegateView() {} | 84 virtual ~MockDraggingRenderViewHostDelegateView() {} |
| 85 virtual void ShowContextMenu(const content::ContextMenuParams& params) {} | 85 virtual void ShowContextMenu( |
| 86 const content::ContextMenuParams& params) OVERRIDE {} |
| 87 virtual void ShowPopupMenu(const gfx::Rect& bounds, |
| 88 int item_height, |
| 89 double item_font_size, |
| 90 int selected_item, |
| 91 const std::vector<WebMenuItem>& items, |
| 92 bool right_aligned, |
| 93 bool allow_multiple_selection) OVERRIDE {} |
| 86 virtual void StartDragging(const WebDropData& drop_data, | 94 virtual void StartDragging(const WebDropData& drop_data, |
| 87 WebKit::WebDragOperationsMask allowed_ops, | 95 WebKit::WebDragOperationsMask allowed_ops, |
| 88 const SkBitmap& image, | 96 const SkBitmap& image, |
| 89 const gfx::Point& image_offset) { | 97 const gfx::Point& image_offset) OVERRIDE { |
| 90 drag_url_ = drop_data.url; | 98 drag_url_ = drop_data.url; |
| 91 html_base_url_ = drop_data.html_base_url; | 99 html_base_url_ = drop_data.html_base_url; |
| 92 } | 100 } |
| 93 virtual void UpdateDragCursor(WebKit::WebDragOperation operation) {} | 101 virtual void UpdateDragCursor(WebKit::WebDragOperation operation) OVERRIDE {} |
| 94 virtual void GotFocus() {} | 102 virtual void GotFocus() OVERRIDE {} |
| 95 virtual void TakeFocus(bool reverse) {} | 103 virtual void TakeFocus(bool reverse) OVERRIDE {} |
| 96 virtual void UpdatePreferredSize(const gfx::Size& pref_size) {} | 104 virtual void UpdatePreferredSize(const gfx::Size& pref_size) {} |
| 97 | 105 |
| 98 GURL drag_url() { | 106 GURL drag_url() { |
| 99 return drag_url_; | 107 return drag_url_; |
| 100 } | 108 } |
| 101 | 109 |
| 102 GURL html_base_url() { | 110 GURL html_base_url() { |
| 103 return html_base_url_; | 111 return html_base_url_; |
| 104 } | 112 } |
| 105 | 113 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 // the code actually expects it to have at least one int para, this this | 210 // the code actually expects it to have at least one int para, this this |
| 203 // bogus message will not fail at de-serialization but should fail in | 211 // bogus message will not fail at de-serialization but should fail in |
| 204 // OnMsgInputEventAck() processing. | 212 // OnMsgInputEventAck() processing. |
| 205 IPC::Message message(0, ViewHostMsg_HandleInputEvent_ACK::ID, | 213 IPC::Message message(0, ViewHostMsg_HandleInputEvent_ACK::ID, |
| 206 IPC::Message::PRIORITY_NORMAL); | 214 IPC::Message::PRIORITY_NORMAL); |
| 207 test_rvh()->OnMessageReceived(message); | 215 test_rvh()->OnMessageReceived(message); |
| 208 EXPECT_EQ(1, process()->bad_msg_count()); | 216 EXPECT_EQ(1, process()->bad_msg_count()); |
| 209 } | 217 } |
| 210 | 218 |
| 211 #endif | 219 #endif |
| OLD | NEW |