| 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/render_frame_host_delegate.h" | 8 #include "content/browser/frame_host/render_frame_host_delegate.h" |
| 9 #include "content/common/frame_messages.h" | 9 #include "content/common/frame_messages.h" |
| 10 #include "content/public/common/page_transition_types.h" | 10 #include "content/public/common/page_transition_types.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 int page_id, | 104 int page_id, |
| 105 const GURL& url, | 105 const GURL& url, |
| 106 const base::FilePath& file_path) { | 106 const base::FilePath& file_path) { |
| 107 SendNavigateWithParameters(page_id, url, PAGE_TRANSITION_LINK, url, 200, | 107 SendNavigateWithParameters(page_id, url, PAGE_TRANSITION_LINK, url, 200, |
| 108 &file_path, std::vector<GURL>()); | 108 &file_path, std::vector<GURL>()); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void TestRenderFrameHost::SendNavigateWithParams( | 111 void TestRenderFrameHost::SendNavigateWithParams( |
| 112 FrameHostMsg_DidCommitProvisionalLoad_Params* params) { | 112 FrameHostMsg_DidCommitProvisionalLoad_Params* params) { |
| 113 FrameHostMsg_DidCommitProvisionalLoad msg(GetRoutingID(), *params); | 113 FrameHostMsg_DidCommitProvisionalLoad msg(GetRoutingID(), *params); |
| 114 OnNavigate(msg); | 114 OnDidCommitProvisionalLoad(msg); |
| 115 } | 115 } |
| 116 | 116 |
| 117 void TestRenderFrameHost::SendNavigateWithRedirects( | 117 void TestRenderFrameHost::SendNavigateWithRedirects( |
| 118 int page_id, | 118 int page_id, |
| 119 const GURL& url, | 119 const GURL& url, |
| 120 const std::vector<GURL>& redirects) { | 120 const std::vector<GURL>& redirects) { |
| 121 SendNavigateWithParameters( | 121 SendNavigateWithParameters( |
| 122 page_id, url, PAGE_TRANSITION_LINK, url, 200, 0, redirects); | 122 page_id, url, PAGE_TRANSITION_LINK, url, 200, 0, redirects); |
| 123 } | 123 } |
| 124 | 124 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 url.ReplaceComponents(replacements) == | 156 url.ReplaceComponents(replacements) == |
| 157 GetLastCommittedURL().ReplaceComponents(replacements); | 157 GetLastCommittedURL().ReplaceComponents(replacements); |
| 158 | 158 |
| 159 params.page_state = PageState::CreateForTesting( | 159 params.page_state = PageState::CreateForTesting( |
| 160 url, | 160 url, |
| 161 false, | 161 false, |
| 162 file_path_for_history_item ? "data" : NULL, | 162 file_path_for_history_item ? "data" : NULL, |
| 163 file_path_for_history_item); | 163 file_path_for_history_item); |
| 164 | 164 |
| 165 FrameHostMsg_DidCommitProvisionalLoad msg(GetRoutingID(), params); | 165 FrameHostMsg_DidCommitProvisionalLoad msg(GetRoutingID(), params); |
| 166 OnNavigate(msg); | 166 OnDidCommitProvisionalLoad(msg); |
| 167 } | 167 } |
| 168 | 168 |
| 169 void TestRenderFrameHost::SendBeginNavigationWithURL(const GURL& url) { | 169 void TestRenderFrameHost::SendBeginNavigationWithURL(const GURL& url) { |
| 170 FrameHostMsg_BeginNavigation_Params params; | 170 FrameHostMsg_BeginNavigation_Params params; |
| 171 params.method = "GET"; | 171 params.method = "GET"; |
| 172 params.url = url; | 172 params.url = url; |
| 173 params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault); | 173 params.referrer = Referrer(GURL(), blink::WebReferrerPolicyDefault); |
| 174 params.load_flags = net::LOAD_NORMAL; | 174 params.load_flags = net::LOAD_NORMAL; |
| 175 params.has_user_gesture = false; | 175 params.has_user_gesture = false; |
| 176 params.transition_type = PAGE_TRANSITION_LINK; | 176 params.transition_type = PAGE_TRANSITION_LINK; |
| 177 params.should_replace_current_entry = false; | 177 params.should_replace_current_entry = false; |
| 178 params.allow_download = true; | 178 params.allow_download = true; |
| 179 OnBeginNavigation(params); | 179 OnBeginNavigation(params); |
| 180 } | 180 } |
| 181 | 181 |
| 182 void TestRenderFrameHost::DidDisownOpener() { | 182 void TestRenderFrameHost::DidDisownOpener() { |
| 183 OnDidDisownOpener(); | 183 OnDidDisownOpener(); |
| 184 } | 184 } |
| 185 | 185 |
| 186 } // namespace content | 186 } // namespace content |
| OLD | NEW |