OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_thread_impl.h" | 5 #include "content/browser/browser_thread_impl.h" |
6 #include "content/browser/browser_url_handler.h" | 6 #include "content/browser/browser_url_handler.h" |
7 #include "content/browser/mock_content_browser_client.h" | 7 #include "content/browser/mock_content_browser_client.h" |
8 #include "content/browser/renderer_host/test_render_view_host.h" | 8 #include "content/browser/renderer_host/test_render_view_host.h" |
9 #include "content/browser/site_instance.h" | 9 #include "content/browser/site_instance.h" |
10 #include "content/browser/tab_contents/navigation_controller.h" | 10 #include "content/browser/tab_contents/navigation_controller.h" |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 // Before that RVH has committed, the evil page reloads itself. | 590 // Before that RVH has committed, the evil page reloads itself. |
591 ViewHostMsg_FrameNavigate_Params params; | 591 ViewHostMsg_FrameNavigate_Params params; |
592 params.page_id = 1; | 592 params.page_id = 1; |
593 params.url = kUrl2; | 593 params.url = kUrl2; |
594 params.transition = content::PAGE_TRANSITION_CLIENT_REDIRECT; | 594 params.transition = content::PAGE_TRANSITION_CLIENT_REDIRECT; |
595 params.should_update_history = false; | 595 params.should_update_history = false; |
596 params.gesture = NavigationGestureAuto; | 596 params.gesture = NavigationGestureAuto; |
597 params.was_within_same_page = false; | 597 params.was_within_same_page = false; |
598 params.is_post = false; | 598 params.is_post = false; |
599 params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(kUrl2)); | 599 params.content_state = webkit_glue::CreateHistoryStateForURL(GURL(kUrl2)); |
600 contents()->DidNavigate(evil_rvh, params); | 600 contents()->TestDidNavigate(evil_rvh, params); |
601 | 601 |
602 // That should have cancelled the pending RVH, and the evil RVH should be the | 602 // That should have cancelled the pending RVH, and the evil RVH should be the |
603 // current one. | 603 // current one. |
604 EXPECT_TRUE(contents()->render_manager_for_testing()-> | 604 EXPECT_TRUE(contents()->render_manager_for_testing()-> |
605 pending_render_view_host() == NULL); | 605 pending_render_view_host() == NULL); |
606 EXPECT_EQ(evil_rvh, contents()->render_manager_for_testing()->current_host()); | 606 EXPECT_EQ(evil_rvh, contents()->render_manager_for_testing()->current_host()); |
607 | 607 |
608 // Also we should not have a pending navigation entry. | 608 // Also we should not have a pending navigation entry. |
609 NavigationEntry* entry = contents()->controller().GetActiveEntry(); | 609 NavigationEntry* entry = contents()->controller().GetActiveEntry(); |
610 ASSERT_TRUE(entry != NULL); | 610 ASSERT_TRUE(entry != NULL); |
611 EXPECT_EQ(kUrl2, entry->url()); | 611 EXPECT_EQ(kUrl2, entry->url()); |
612 } | 612 } |
OLD | NEW |