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" |
11 #include "content/port/browser/render_view_host_delegate_view.h" | 11 #include "content/port/browser/render_view_host_delegate_view.h" |
12 #include "content/public/browser/navigation_entry.h" | 12 #include "content/public/browser/navigation_entry.h" |
13 #include "content/public/common/bindings_policy.h" | 13 #include "content/public/common/bindings_policy.h" |
14 #include "content/public/common/page_transition_types.h" | 14 #include "content/public/common/page_transition_types.h" |
15 #include "content/public/test/mock_render_process_host.h" | 15 #include "content/public/test/mock_render_process_host.h" |
16 #include "net/base/net_util.h" | 16 #include "net/base/net_util.h" |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDragOperation.h" |
18 #include "webkit/glue/webdropdata.h" | 18 #include "webkit/glue/webdropdata.h" |
19 | 19 |
20 using content::ChildProcessSecurityPolicyImpl; | |
21 using content::RenderViewHostImplTestHarness; | 20 using content::RenderViewHostImplTestHarness; |
22 using content::TestWebContents; | 21 using content::TestWebContents; |
23 | 22 |
24 class RenderViewHostTest : public RenderViewHostImplTestHarness { | 23 class RenderViewHostTest : public RenderViewHostImplTestHarness { |
25 }; | 24 }; |
26 | 25 |
27 // All about URLs reported by the renderer should get rewritten to about:blank. | 26 // All about URLs reported by the renderer should get rewritten to about:blank. |
28 // See RenderViewHost::OnMsgNavigate for a discussion. | 27 // See RenderViewHost::OnMsgNavigate for a discussion. |
29 TEST_F(RenderViewHostTest, FilterAbout) { | 28 TEST_F(RenderViewHostTest, FilterAbout) { |
30 test_rvh()->SendNavigate(1, GURL("about:cache")); | 29 test_rvh()->SendNavigate(1, GURL("about:cache")); |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 // the code actually expects it to have at least one int para, this this | 218 // the code actually expects it to have at least one int para, this this |
220 // bogus message will not fail at de-serialization but should fail in | 219 // bogus message will not fail at de-serialization but should fail in |
221 // OnMsgInputEventAck() processing. | 220 // OnMsgInputEventAck() processing. |
222 IPC::Message message(0, ViewHostMsg_HandleInputEvent_ACK::ID, | 221 IPC::Message message(0, ViewHostMsg_HandleInputEvent_ACK::ID, |
223 IPC::Message::PRIORITY_NORMAL); | 222 IPC::Message::PRIORITY_NORMAL); |
224 test_rvh()->OnMessageReceived(message); | 223 test_rvh()->OnMessageReceived(message); |
225 EXPECT_EQ(1, process()->bad_msg_count()); | 224 EXPECT_EQ(1, process()->bad_msg_count()); |
226 } | 225 } |
227 | 226 |
228 #endif | 227 #endif |
OLD | NEW |