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/path_service.h" | 5 #include "base/path_service.h" |
6 #include "base/strings/utf_string_conversions.h" | 6 #include "base/strings/utf_string_conversions.h" |
7 #include "content/browser/child_process_security_policy_impl.h" | 7 #include "content/browser/child_process_security_policy_impl.h" |
8 #include "content/browser/frame_host/render_frame_host_impl.h" | |
9 #include "content/common/input_messages.h" | 8 #include "content/common/input_messages.h" |
10 #include "content/common/view_messages.h" | 9 #include "content/common/view_messages.h" |
11 #include "content/port/browser/render_view_host_delegate_view.h" | 10 #include "content/port/browser/render_view_host_delegate_view.h" |
12 #include "content/public/browser/navigation_entry.h" | 11 #include "content/public/browser/navigation_entry.h" |
13 #include "content/public/common/bindings_policy.h" | 12 #include "content/public/common/bindings_policy.h" |
14 #include "content/public/common/drop_data.h" | 13 #include "content/public/common/drop_data.h" |
15 #include "content/public/common/page_transition_types.h" | 14 #include "content/public/common/page_transition_types.h" |
16 #include "content/public/common/url_constants.h" | 15 #include "content/public/common/url_constants.h" |
17 #include "content/public/test/mock_render_process_host.h" | 16 #include "content/public/test/mock_render_process_host.h" |
18 #include "content/test/test_content_browser_client.h" | 17 #include "content/test/test_content_browser_client.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 test_rvh()->SendNavigateWithFile(1, url, file_path); | 281 test_rvh()->SendNavigateWithFile(1, url, file_path); |
283 EXPECT_EQ(1, process()->bad_msg_count()); | 282 EXPECT_EQ(1, process()->bad_msg_count()); |
284 | 283 |
285 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( | 284 ChildProcessSecurityPolicyImpl::GetInstance()->GrantReadFile( |
286 process()->GetID(), file_path); | 285 process()->GetID(), file_path); |
287 test_rvh()->SendNavigateWithFile(process()->GetID(), url, file_path); | 286 test_rvh()->SendNavigateWithFile(process()->GetID(), url, file_path); |
288 EXPECT_EQ(1, process()->bad_msg_count()); | 287 EXPECT_EQ(1, process()->bad_msg_count()); |
289 } | 288 } |
290 | 289 |
291 TEST_F(RenderViewHostTest, RoutingIdSane) { | 290 TEST_F(RenderViewHostTest, RoutingIdSane) { |
292 RenderFrameHostImpl* root_rfh = | 291 EXPECT_EQ(test_rvh()->GetProcess(), |
293 contents()->GetFrameTree()->root()->current_frame_host(); | 292 test_rvh()->main_render_frame_host()->GetProcess()); |
294 EXPECT_EQ(test_rvh()->GetProcess(), root_rfh->GetProcess()); | 293 EXPECT_NE(test_rvh()->GetRoutingID(), |
295 EXPECT_NE(test_rvh()->GetRoutingID(), root_rfh->routing_id()); | 294 test_rvh()->main_render_frame_host()->routing_id()); |
296 } | 295 } |
297 | 296 |
298 } // namespace content | 297 } // namespace content |
OLD | NEW |