Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: content/browser/frame_host/render_frame_host_manager_unittest.cc

Issue 556703004: Remove page id from FrameNavigateParams. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/files/file_path.h" 6 #include "base/files/file_path.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "base/test/histogram_tester.h" 8 #include "base/test/histogram_tester.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "content/browser/frame_host/cross_site_transferring_request.h" 10 #include "content/browser/frame_host/cross_site_transferring_request.h"
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 contents()->OnGoToEntryAtOffset(-1); 1079 contents()->OnGoToEntryAtOffset(-1);
1080 // We should have a new pending RFH. 1080 // We should have a new pending RFH.
1081 // Note that in this case, the navigation has not committed, so evil_rfh will 1081 // Note that in this case, the navigation has not committed, so evil_rfh will
1082 // not be deleted yet. 1082 // not be deleted yet.
1083 EXPECT_NE(evil_rfh, contents()->GetPendingMainFrame()); 1083 EXPECT_NE(evil_rfh, contents()->GetPendingMainFrame());
1084 EXPECT_NE(evil_rfh->GetRenderViewHost(), 1084 EXPECT_NE(evil_rfh->GetRenderViewHost(),
1085 contents()->GetPendingMainFrame()->GetRenderViewHost()); 1085 contents()->GetPendingMainFrame()->GetRenderViewHost());
1086 1086
1087 // Before that RFH has committed, the evil page reloads itself. 1087 // Before that RFH has committed, the evil page reloads itself.
1088 FrameHostMsg_DidCommitProvisionalLoad_Params params; 1088 FrameHostMsg_DidCommitProvisionalLoad_Params params;
1089 params.page_id = 1;
1090 params.url = kUrl2; 1089 params.url = kUrl2;
1091 params.transition = ui::PAGE_TRANSITION_CLIENT_REDIRECT; 1090 params.transition = ui::PAGE_TRANSITION_CLIENT_REDIRECT;
1092 params.should_update_history = false; 1091 params.should_update_history = false;
1093 params.gesture = NavigationGestureAuto; 1092 params.gesture = NavigationGestureAuto;
1094 params.was_within_same_page = false; 1093 params.was_within_same_page = false;
1095 params.is_post = false; 1094 params.is_post = false;
1096 params.page_state = PageState::CreateFromURL(kUrl2); 1095 params.page_state = PageState::CreateFromURL(kUrl2);
1097 1096
1098 contents()->GetFrameTree()->root()->navigator()->DidNavigate(evil_rfh, 1097 contents()->GetFrameTree()->root()->navigator()->DidNavigate(evil_rfh, 1,
1099 params); 1098 params);
1100 1099
1101 // That should have cancelled the pending RFH, and the evil RFH should be the 1100 // That should have cancelled the pending RFH, and the evil RFH should be the
1102 // current one. 1101 // current one.
1103 EXPECT_TRUE(contents()->GetRenderManagerForTesting()-> 1102 EXPECT_TRUE(contents()->GetRenderManagerForTesting()->
1104 pending_render_view_host() == NULL); 1103 pending_render_view_host() == NULL);
1105 EXPECT_TRUE(contents()->GetRenderManagerForTesting()->pending_frame_host() == 1104 EXPECT_TRUE(contents()->GetRenderManagerForTesting()->pending_frame_host() ==
1106 NULL); 1105 NULL);
1107 EXPECT_EQ(evil_rfh, 1106 EXPECT_EQ(evil_rfh,
1108 contents()->GetRenderManagerForTesting()->current_frame_host()); 1107 contents()->GetRenderManagerForTesting()->current_frame_host());
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
1796 pending_rfh->GetSiteInstance()->increment_active_frame_count(); 1795 pending_rfh->GetSiteInstance()->increment_active_frame_count();
1797 1796
1798 contents()->GetMainFrame()->OnMessageReceived( 1797 contents()->GetMainFrame()->OnMessageReceived(
1799 FrameHostMsg_BeforeUnload_ACK(0, false, now, now)); 1798 FrameHostMsg_BeforeUnload_ACK(0, false, now, now));
1800 EXPECT_FALSE(contents()->cross_navigation_pending()); 1799 EXPECT_FALSE(contents()->cross_navigation_pending());
1801 EXPECT_FALSE(rfh_deleted_observer.deleted()); 1800 EXPECT_FALSE(rfh_deleted_observer.deleted());
1802 } 1801 }
1803 } 1802 }
1804 1803
1805 } // namespace content 1804 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/web_contents/web_contents_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698