| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/test/test_render_frame_host.h" | 5 #include "content/test/test_render_frame_host.h" |
| 6 | 6 |
| 7 #include "base/guid.h" | 7 #include "base/guid.h" |
| 8 #include "content/browser/frame_host/frame_tree.h" | 8 #include "content/browser/frame_host/frame_tree.h" |
| 9 #include "content/browser/frame_host/navigation_handle_impl.h" | 9 #include "content/browser/frame_host/navigation_handle_impl.h" |
| 10 #include "content/browser/frame_host/navigation_request.h" | 10 #include "content/browser/frame_host/navigation_request.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 render_view_host, | 53 render_view_host, |
| 54 delegate, | 54 delegate, |
| 55 rwh_delegate, | 55 rwh_delegate, |
| 56 frame_tree, | 56 frame_tree, |
| 57 frame_tree_node, | 57 frame_tree_node, |
| 58 routing_id, | 58 routing_id, |
| 59 widget_routing_id, | 59 widget_routing_id, |
| 60 flags), | 60 flags), |
| 61 child_creation_observer_(delegate ? delegate->GetAsWebContents() : NULL), | 61 child_creation_observer_(delegate ? delegate->GetAsWebContents() : NULL), |
| 62 contents_mime_type_("text/html"), | 62 contents_mime_type_("text/html"), |
| 63 simulate_history_list_was_cleared_(false) {} | 63 simulate_history_list_was_cleared_(false), |
| 64 simulate_fetch_via_data_reduction_proxy_(false) {} |
| 64 | 65 |
| 65 TestRenderFrameHost::~TestRenderFrameHost() { | 66 TestRenderFrameHost::~TestRenderFrameHost() { |
| 66 } | 67 } |
| 67 | 68 |
| 68 TestRenderViewHost* TestRenderFrameHost::GetRenderViewHost() { | 69 TestRenderViewHost* TestRenderFrameHost::GetRenderViewHost() { |
| 69 return static_cast<TestRenderViewHost*>( | 70 return static_cast<TestRenderViewHost*>( |
| 70 RenderFrameHostImpl::GetRenderViewHost()); | 71 RenderFrameHostImpl::GetRenderViewHost()); |
| 71 } | 72 } |
| 72 | 73 |
| 73 MockRenderProcessHost* TestRenderFrameHost::GetProcess() { | 74 MockRenderProcessHost* TestRenderFrameHost::GetProcess() { |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 params.should_update_history = true; | 286 params.should_update_history = true; |
| 286 params.did_create_new_entry = did_create_new_entry; | 287 params.did_create_new_entry = did_create_new_entry; |
| 287 params.gesture = NavigationGestureUser; | 288 params.gesture = NavigationGestureUser; |
| 288 params.contents_mime_type = contents_mime_type_; | 289 params.contents_mime_type = contents_mime_type_; |
| 289 params.is_post = false; | 290 params.is_post = false; |
| 290 params.http_status_code = response_code; | 291 params.http_status_code = response_code; |
| 291 params.socket_address.set_host("2001:db8::1"); | 292 params.socket_address.set_host("2001:db8::1"); |
| 292 params.socket_address.set_port(80); | 293 params.socket_address.set_port(80); |
| 293 params.history_list_was_cleared = simulate_history_list_was_cleared_; | 294 params.history_list_was_cleared = simulate_history_list_was_cleared_; |
| 294 params.original_request_url = url_copy; | 295 params.original_request_url = url_copy; |
| 296 params.used_data_reduction_proxy = simulate_fetch_via_data_reduction_proxy_; |
| 295 | 297 |
| 296 // In most cases, the origin will match the URL's origin. Tests that need to | 298 // In most cases, the origin will match the URL's origin. Tests that need to |
| 297 // check corner cases (like about:blank) should specify the origin param | 299 // check corner cases (like about:blank) should specify the origin param |
| 298 // manually. | 300 // manually. |
| 299 url::Origin origin(url_copy); | 301 url::Origin origin(url_copy); |
| 300 params.origin = origin; | 302 params.origin = origin; |
| 301 | 303 |
| 302 url::Replacements<char> replacements; | 304 url::Replacements<char> replacements; |
| 303 replacements.ClearRef(); | 305 replacements.ClearRef(); |
| 304 params.was_within_same_page = | 306 params.was_within_same_page = |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 // cleared during DidFailProvisionalLoad). | 418 // cleared during DidFailProvisionalLoad). |
| 417 int page_id = entry ? entry->GetPageID() : -1; | 419 int page_id = entry ? entry->GetPageID() : -1; |
| 418 if (page_id == -1) { | 420 if (page_id == -1) { |
| 419 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); | 421 WebContentsImpl* web_contents = static_cast<WebContentsImpl*>(delegate()); |
| 420 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; | 422 page_id = web_contents->GetMaxPageIDForSiteInstance(GetSiteInstance()) + 1; |
| 421 } | 423 } |
| 422 return page_id; | 424 return page_id; |
| 423 } | 425 } |
| 424 | 426 |
| 425 } // namespace content | 427 } // namespace content |
| OLD | NEW |