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/command_line.h" | 7 #include "base/command_line.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_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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 ui::PageTransition transition, | 127 ui::PageTransition transition, |
128 int response_code) { | 128 int response_code) { |
129 // DidStartProvisionalLoad may delete the pending entry that holds |url|, | 129 // DidStartProvisionalLoad may delete the pending entry that holds |url|, |
130 // so we keep a copy of it to use in SendNavigateWithParameters. | 130 // so we keep a copy of it to use in SendNavigateWithParameters. |
131 GURL url_copy(url); | 131 GURL url_copy(url); |
132 | 132 |
133 // Ensure that the RenderFrameCreated notification has been sent to observers | 133 // Ensure that the RenderFrameCreated notification has been sent to observers |
134 // before navigating the frame. | 134 // before navigating the frame. |
135 SetRenderFrameCreated(true); | 135 SetRenderFrameCreated(true); |
136 | 136 |
137 OnDidStartProvisionalLoadForFrame(url_copy, false); | 137 OnDidStartProvisionalLoadForFrame(url_copy); |
138 SendNavigateWithParameters(page_id, nav_entry_id, did_create_new_entry, | 138 SendNavigateWithParameters(page_id, nav_entry_id, did_create_new_entry, |
139 url_copy, transition, url_copy, response_code, 0, | 139 url_copy, transition, url_copy, response_code, 0, |
140 std::vector<GURL>()); | 140 std::vector<GURL>()); |
141 } | 141 } |
142 | 142 |
143 void TestRenderFrameHost::SendNavigateWithOriginalRequestURL( | 143 void TestRenderFrameHost::SendNavigateWithOriginalRequestURL( |
144 int page_id, | 144 int page_id, |
145 int nav_entry_id, | 145 int nav_entry_id, |
146 bool did_create_new_entry, | 146 bool did_create_new_entry, |
147 const GURL& url, | 147 const GURL& url, |
148 const GURL& original_request_url) { | 148 const GURL& original_request_url) { |
149 // Ensure that the RenderFrameCreated notification has been sent to observers | 149 // Ensure that the RenderFrameCreated notification has been sent to observers |
150 // before navigating the frame. | 150 // before navigating the frame. |
151 SetRenderFrameCreated(true); | 151 SetRenderFrameCreated(true); |
152 | 152 |
153 OnDidStartProvisionalLoadForFrame(url, false); | 153 OnDidStartProvisionalLoadForFrame(url); |
154 SendNavigateWithParameters(page_id, nav_entry_id, did_create_new_entry, url, | 154 SendNavigateWithParameters(page_id, nav_entry_id, did_create_new_entry, url, |
155 ui::PAGE_TRANSITION_LINK, original_request_url, | 155 ui::PAGE_TRANSITION_LINK, original_request_url, |
156 200, 0, std::vector<GURL>()); | 156 200, 0, std::vector<GURL>()); |
157 } | 157 } |
158 | 158 |
159 void TestRenderFrameHost::SendNavigateWithFile( | 159 void TestRenderFrameHost::SendNavigateWithFile( |
160 int page_id, | 160 int page_id, |
161 int nav_entry_id, | 161 int nav_entry_id, |
162 bool did_create_new_entry, | 162 bool did_create_new_entry, |
163 const GURL& url, | 163 const GURL& url, |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 url_loader->SimulateServerRedirect(redirect_url); | 301 url_loader->SimulateServerRedirect(redirect_url); |
302 | 302 |
303 // Simulate the network stack commit. | 303 // Simulate the network stack commit. |
304 scoped_refptr<ResourceResponse> response(new ResourceResponse); | 304 scoped_refptr<ResourceResponse> response(new ResourceResponse); |
305 // TODO(carlosk): ideally with PlzNavigate it should be possible someday to | 305 // TODO(carlosk): ideally with PlzNavigate it should be possible someday to |
306 // fully commit the navigation at this call to CallOnResponseStarted. | 306 // fully commit the navigation at this call to CallOnResponseStarted. |
307 url_loader->CallOnResponseStarted(response, MakeEmptyStream()); | 307 url_loader->CallOnResponseStarted(response, MakeEmptyStream()); |
308 } | 308 } |
309 | 309 |
310 } // namespace content | 310 } // namespace content |
OLD | NEW |