| 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/navigation_handle_impl.h" |
| 12 #include "content/browser/frame_host/navigator.h" | 13 #include "content/browser/frame_host/navigator.h" |
| 13 #include "content/browser/frame_host/navigator_impl.h" | 14 #include "content/browser/frame_host/navigator_impl.h" |
| 14 #include "content/browser/renderer_host/render_view_host_impl.h" | 15 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 15 #include "content/browser/site_instance_impl.h" | 16 #include "content/browser/site_instance_impl.h" |
| 16 #include "content/common/frame_messages.h" | 17 #include "content/common/frame_messages.h" |
| 17 #include "content/common/view_messages.h" | 18 #include "content/common/view_messages.h" |
| 19 #include "content/public/browser/navigation_data.h" |
| 18 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
| 19 #include "content/public/browser/notification_source.h" | 21 #include "content/public/browser/notification_source.h" |
| 20 #include "content/public/browser/notification_types.h" | 22 #include "content/public/browser/notification_types.h" |
| 21 #include "content/public/common/browser_side_navigation_policy.h" | 23 #include "content/public/common/browser_side_navigation_policy.h" |
| 22 #include "content/public/common/page_state.h" | 24 #include "content/public/common/page_state.h" |
| 23 #include "content/public/test/mock_render_process_host.h" | 25 #include "content/public/test/mock_render_process_host.h" |
| 24 #include "content/test/test_render_view_host.h" | 26 #include "content/test/test_render_view_host.h" |
| 25 #include "ui/base/page_transition_types.h" | 27 #include "ui/base/page_transition_types.h" |
| 26 | 28 |
| 27 namespace content { | 29 namespace content { |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 void TestWebContents::TestDidFailLoadWithError( | 308 void TestWebContents::TestDidFailLoadWithError( |
| 307 const GURL& url, | 309 const GURL& url, |
| 308 int error_code, | 310 int error_code, |
| 309 const base::string16& error_description, | 311 const base::string16& error_description, |
| 310 bool was_ignored_by_handler) { | 312 bool was_ignored_by_handler) { |
| 311 FrameHostMsg_DidFailLoadWithError msg( | 313 FrameHostMsg_DidFailLoadWithError msg( |
| 312 0, url, error_code, error_description, was_ignored_by_handler); | 314 0, url, error_code, error_description, was_ignored_by_handler); |
| 313 frame_tree_.root()->current_frame_host()->OnMessageReceived(msg); | 315 frame_tree_.root()->current_frame_host()->OnMessageReceived(msg); |
| 314 } | 316 } |
| 315 | 317 |
| 318 void TestWebContents::SetNavigationData( |
| 319 NavigationHandle* navigation_handle, |
| 320 std::unique_ptr<NavigationData> navigation_data) { |
| 321 static_cast<NavigationHandleImpl*>(navigation_handle) |
| 322 ->set_navigation_data(std::move(navigation_data)); |
| 323 } |
| 324 |
| 316 void TestWebContents::CreateNewWindow( | 325 void TestWebContents::CreateNewWindow( |
| 317 SiteInstance* source_site_instance, | 326 SiteInstance* source_site_instance, |
| 318 int32_t route_id, | 327 int32_t route_id, |
| 319 int32_t main_frame_route_id, | 328 int32_t main_frame_route_id, |
| 320 int32_t main_frame_widget_route_id, | 329 int32_t main_frame_widget_route_id, |
| 321 const ViewHostMsg_CreateWindow_Params& params, | 330 const ViewHostMsg_CreateWindow_Params& params, |
| 322 SessionStorageNamespace* session_storage_namespace) {} | 331 SessionStorageNamespace* session_storage_namespace) {} |
| 323 | 332 |
| 324 void TestWebContents::CreateNewWidget(int32_t render_process_id, | 333 void TestWebContents::CreateNewWidget(int32_t render_process_id, |
| 325 int32_t route_id, | 334 int32_t route_id, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 341 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { | 350 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { |
| 342 } | 351 } |
| 343 | 352 |
| 344 void TestWebContents::SaveFrameWithHeaders(const GURL& url, | 353 void TestWebContents::SaveFrameWithHeaders(const GURL& url, |
| 345 const Referrer& referrer, | 354 const Referrer& referrer, |
| 346 const std::string& headers) { | 355 const std::string& headers) { |
| 347 save_frame_headers_ = headers; | 356 save_frame_headers_ = headers; |
| 348 } | 357 } |
| 349 | 358 |
| 350 } // namespace content | 359 } // namespace content |
| OLD | NEW |