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 "content/browser/renderer_host/test_backing_store.h" | 5 #include "content/browser/renderer_host/test_backing_store.h" |
6 #include "content/browser/renderer_host/test_render_view_host.h" | 6 #include "content/browser/renderer_host/test_render_view_host.h" |
7 #include "content/browser/site_instance_impl.h" | 7 #include "content/browser/site_instance_impl.h" |
8 #include "content/browser/web_contents/navigation_controller_impl.h" | 8 #include "content/browser/web_contents/navigation_controller_impl.h" |
9 #include "content/browser/web_contents/test_web_contents.h" | 9 #include "content/browser/web_contents/test_web_contents.h" |
10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 return render_view_created_; | 256 return render_view_created_; |
257 } | 257 } |
258 | 258 |
259 void TestRenderViewHost::SendNavigate(int page_id, const GURL& url) { | 259 void TestRenderViewHost::SendNavigate(int page_id, const GURL& url) { |
260 SendNavigateWithTransition(page_id, url, PAGE_TRANSITION_LINK); | 260 SendNavigateWithTransition(page_id, url, PAGE_TRANSITION_LINK); |
261 } | 261 } |
262 | 262 |
263 void TestRenderViewHost::SendNavigateWithTransition( | 263 void TestRenderViewHost::SendNavigateWithTransition( |
264 int page_id, const GURL& url, PageTransition transition) { | 264 int page_id, const GURL& url, PageTransition transition) { |
265 OnMsgDidStartProvisionalLoadForFrame(0, true, GURL(), url); | 265 OnMsgDidStartProvisionalLoadForFrame(0, true, GURL(), url); |
| 266 SendNavigateWithParameters(page_id, url, transition, url); |
| 267 } |
266 | 268 |
| 269 void TestRenderViewHost::SendNavigateWithOriginalRequestURL( |
| 270 int page_id, const GURL& url, const GURL& original_request_url) { |
| 271 OnMsgDidStartProvisionalLoadForFrame(0, true, GURL(), url); |
| 272 SendNavigateWithParameters(page_id, url, PAGE_TRANSITION_LINK, |
| 273 original_request_url); |
| 274 } |
| 275 |
| 276 void TestRenderViewHost::SendNavigateWithParameters( |
| 277 int page_id, const GURL& url, PageTransition transition, |
| 278 const GURL& original_request_url) { |
267 ViewHostMsg_FrameNavigate_Params params; | 279 ViewHostMsg_FrameNavigate_Params params; |
268 | 280 |
269 params.page_id = page_id; | 281 params.page_id = page_id; |
270 params.frame_id = 0; | 282 params.frame_id = 0; |
271 params.url = url; | 283 params.url = url; |
272 params.referrer = Referrer(); | 284 params.referrer = Referrer(); |
273 params.transition = transition; | 285 params.transition = transition; |
274 params.redirects = std::vector<GURL>(); | 286 params.redirects = std::vector<GURL>(); |
275 params.should_update_history = true; | 287 params.should_update_history = true; |
276 params.searchable_form_url = GURL(); | 288 params.searchable_form_url = GURL(); |
277 params.searchable_form_encoding = std::string(); | 289 params.searchable_form_encoding = std::string(); |
278 params.password_form = PasswordForm(); | 290 params.password_form = PasswordForm(); |
279 params.security_info = std::string(); | 291 params.security_info = std::string(); |
280 params.gesture = NavigationGestureUser; | 292 params.gesture = NavigationGestureUser; |
281 params.contents_mime_type = contents_mime_type_; | 293 params.contents_mime_type = contents_mime_type_; |
282 params.is_post = false; | 294 params.is_post = false; |
283 params.was_within_same_page = false; | 295 params.was_within_same_page = false; |
284 params.http_status_code = 0; | 296 params.http_status_code = 0; |
285 params.socket_address.set_host("2001:db8::1"); | 297 params.socket_address.set_host("2001:db8::1"); |
286 params.socket_address.set_port(80); | 298 params.socket_address.set_port(80); |
287 params.was_fetched_via_proxy = simulate_fetch_via_proxy_; | 299 params.was_fetched_via_proxy = simulate_fetch_via_proxy_; |
288 params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url)); | 300 params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(url)); |
| 301 params.original_request_url = original_request_url; |
289 | 302 |
290 ViewHostMsg_FrameNavigate msg(1, params); | 303 ViewHostMsg_FrameNavigate msg(1, params); |
291 OnMsgNavigate(msg); | 304 OnMsgNavigate(msg); |
292 } | 305 } |
293 | 306 |
294 void TestRenderViewHost::SendShouldCloseACK(bool proceed) { | 307 void TestRenderViewHost::SendShouldCloseACK(bool proceed) { |
295 OnMsgShouldCloseACK(proceed, base::TimeTicks(), base::TimeTicks()); | 308 OnMsgShouldCloseACK(proceed, base::TimeTicks(), base::TimeTicks()); |
296 } | 309 } |
297 | 310 |
298 void TestRenderViewHost::SetContentsMimeType(const std::string& mime_type) { | 311 void TestRenderViewHost::SetContentsMimeType(const std::string& mime_type) { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 | 350 |
338 TestRenderViewHost* RenderViewHostImplTestHarness::active_test_rvh() { | 351 TestRenderViewHost* RenderViewHostImplTestHarness::active_test_rvh() { |
339 return static_cast<TestRenderViewHost*>(active_rvh()); | 352 return static_cast<TestRenderViewHost*>(active_rvh()); |
340 } | 353 } |
341 | 354 |
342 TestWebContents* RenderViewHostImplTestHarness::contents() { | 355 TestWebContents* RenderViewHostImplTestHarness::contents() { |
343 return static_cast<TestWebContents*>(web_contents()); | 356 return static_cast<TestWebContents*>(web_contents()); |
344 } | 357 } |
345 | 358 |
346 } // namespace content | 359 } // namespace content |
OLD | NEW |