| 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/test/test_web_contents.h" | 5 #include "content/test/test_web_contents.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "content/browser/browser_url_handler_impl.h" | 9 #include "content/browser/browser_url_handler_impl.h" |
| 10 #include "content/browser/frame_host/cross_process_frame_connector.h" | 10 #include "content/browser/frame_host/cross_process_frame_connector.h" |
| 11 #include "content/browser/frame_host/navigation_entry_impl.h" | 11 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 12 #include "content/browser/frame_host/navigator.h" |
| 12 #include "content/browser/renderer_host/render_view_host_impl.h" | 13 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 13 #include "content/browser/site_instance_impl.h" | 14 #include "content/browser/site_instance_impl.h" |
| 15 #include "content/common/frame_messages.h" |
| 14 #include "content/common/view_messages.h" | 16 #include "content/common/view_messages.h" |
| 15 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 16 #include "content/public/browser/notification_source.h" | 18 #include "content/public/browser/notification_source.h" |
| 17 #include "content/public/browser/notification_types.h" | 19 #include "content/public/browser/notification_types.h" |
| 18 #include "content/public/common/page_state.h" | 20 #include "content/public/common/page_state.h" |
| 19 #include "content/public/common/page_transition_types.h" | 21 #include "content/public/common/page_transition_types.h" |
| 20 #include "content/public/test/mock_render_process_host.h" | 22 #include "content/public/test/mock_render_process_host.h" |
| 21 #include "content/test/test_render_view_host.h" | 23 #include "content/test/test_render_view_host.h" |
| 22 | 24 |
| 23 namespace content { | 25 namespace content { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 Referrer(), | 63 Referrer(), |
| 62 transition); | 64 transition); |
| 63 } | 65 } |
| 64 | 66 |
| 65 void TestWebContents::TestDidNavigateWithReferrer( | 67 void TestWebContents::TestDidNavigateWithReferrer( |
| 66 RenderViewHost* render_view_host, | 68 RenderViewHost* render_view_host, |
| 67 int page_id, | 69 int page_id, |
| 68 const GURL& url, | 70 const GURL& url, |
| 69 const Referrer& referrer, | 71 const Referrer& referrer, |
| 70 PageTransition transition) { | 72 PageTransition transition) { |
| 71 ViewHostMsg_FrameNavigate_Params params; | 73 FrameHostMsg_DidCommitProvisionalLoad_Params params; |
| 72 | 74 |
| 73 params.page_id = page_id; | 75 params.page_id = page_id; |
| 74 params.url = url; | 76 params.url = url; |
| 75 params.referrer = referrer; | 77 params.referrer = referrer; |
| 76 params.transition = transition; | 78 params.transition = transition; |
| 77 params.redirects = std::vector<GURL>(); | 79 params.redirects = std::vector<GURL>(); |
| 78 params.should_update_history = false; | 80 params.should_update_history = false; |
| 79 params.searchable_form_url = GURL(); | 81 params.searchable_form_url = GURL(); |
| 80 params.searchable_form_encoding = std::string(); | 82 params.searchable_form_encoding = std::string(); |
| 81 params.security_info = std::string(); | 83 params.security_info = std::string(); |
| 82 params.gesture = NavigationGestureUser; | 84 params.gesture = NavigationGestureUser; |
| 83 params.was_within_same_page = false; | 85 params.was_within_same_page = false; |
| 84 params.is_post = false; | 86 params.is_post = false; |
| 85 params.page_state = PageState::CreateFromURL(url); | 87 params.page_state = PageState::CreateFromURL(url); |
| 86 | 88 |
| 87 DidNavigate(render_view_host, params); | 89 RenderViewHostImpl* rvh = static_cast<RenderViewHostImpl*>(render_view_host); |
| 90 RenderFrameHostImpl* rfh = RenderFrameHostImpl::FromID( |
| 91 rvh->GetProcess()->GetID(), rvh->main_frame_routing_id()); |
| 92 frame_tree_.root()->navigator()->DidNavigate(rfh, params); |
| 88 } | 93 } |
| 89 | 94 |
| 90 WebPreferences TestWebContents::TestGetWebkitPrefs() { | 95 WebPreferences TestWebContents::TestGetWebkitPrefs() { |
| 91 return GetWebkitPrefs(); | 96 return GetWebkitPrefs(); |
| 92 } | 97 } |
| 93 | 98 |
| 94 bool TestWebContents::CreateRenderViewForRenderManager( | 99 bool TestWebContents::CreateRenderViewForRenderManager( |
| 95 RenderViewHost* render_view_host, | 100 RenderViewHost* render_view_host, |
| 96 int opener_route_id, | 101 int opener_route_id, |
| 97 CrossProcessFrameConnector* frame_connector) { | 102 CrossProcessFrameConnector* frame_connector) { |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 } | 250 } |
| 246 | 251 |
| 247 void TestWebContents::ShowCreatedWidget(int route_id, | 252 void TestWebContents::ShowCreatedWidget(int route_id, |
| 248 const gfx::Rect& initial_pos) { | 253 const gfx::Rect& initial_pos) { |
| 249 } | 254 } |
| 250 | 255 |
| 251 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { | 256 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { |
| 252 } | 257 } |
| 253 | 258 |
| 254 } // namespace content | 259 } // namespace content |
| OLD | NEW |