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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 test_rvh()->SendShouldCloseACK(true); | 65 test_rvh()->SendShouldCloseACK(true); |
66 contents()->Stop(); | 66 contents()->Stop(); |
67 controller().Reload(false); | 67 controller().Reload(false); |
68 EXPECT_FALSE(test_rvh()->is_waiting_for_unload_ack_for_testing()); | 68 EXPECT_FALSE(test_rvh()->is_waiting_for_unload_ack_for_testing()); |
69 } | 69 } |
70 | 70 |
71 // Ensure we do not grant bindings to a process shared with unprivileged views. | 71 // Ensure we do not grant bindings to a process shared with unprivileged views. |
72 TEST_F(RenderViewHostTest, DontGrantBindingsToSharedProcess) { | 72 TEST_F(RenderViewHostTest, DontGrantBindingsToSharedProcess) { |
73 // Create another view in the same process. | 73 // Create another view in the same process. |
74 scoped_ptr<TestWebContents> new_web_contents( | 74 scoped_ptr<TestWebContents> new_web_contents( |
75 new TestWebContents(browser_context(), rvh()->GetSiteInstance())); | 75 TestWebContents::Create(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( | 85 virtual void ShowContextMenu( |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // the code actually expects it to have at least one int para, this this | 216 // the code actually expects it to have at least one int para, this this |
217 // bogus message will not fail at de-serialization but should fail in | 217 // bogus message will not fail at de-serialization but should fail in |
218 // OnMsgInputEventAck() processing. | 218 // OnMsgInputEventAck() processing. |
219 IPC::Message message(0, ViewHostMsg_HandleInputEvent_ACK::ID, | 219 IPC::Message message(0, ViewHostMsg_HandleInputEvent_ACK::ID, |
220 IPC::Message::PRIORITY_NORMAL); | 220 IPC::Message::PRIORITY_NORMAL); |
221 test_rvh()->OnMessageReceived(message); | 221 test_rvh()->OnMessageReceived(message); |
222 EXPECT_EQ(1, process()->bad_msg_count()); | 222 EXPECT_EQ(1, process()->bad_msg_count()); |
223 } | 223 } |
224 | 224 |
225 #endif | 225 #endif |
OLD | NEW |