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