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

Side by Side Diff: content/test/test_web_contents.cc

Issue 1136553005: Revert of Classify navigations without page id in parallel to the existing classifier. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months 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
« no previous file with comments | « content/test/test_web_contents.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/command_line.h" 9 #include "base/command_line.h"
10 #include "content/browser/browser_url_handler_impl.h" 10 #include "content/browser/browser_url_handler_impl.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 switches::kEnableBrowserSideNavigation)) { 60 switches::kEnableBrowserSideNavigation)) {
61 return static_cast<TestRenderFrameHost*>( 61 return static_cast<TestRenderFrameHost*>(
62 GetRenderManager()->speculative_render_frame_host_.get()); 62 GetRenderManager()->speculative_render_frame_host_.get());
63 } 63 }
64 return static_cast<TestRenderFrameHost*>( 64 return static_cast<TestRenderFrameHost*>(
65 GetRenderManager()->pending_frame_host()); 65 GetRenderManager()->pending_frame_host());
66 } 66 }
67 67
68 void TestWebContents::TestDidNavigate(RenderFrameHost* render_frame_host, 68 void TestWebContents::TestDidNavigate(RenderFrameHost* render_frame_host,
69 int page_id, 69 int page_id,
70 int nav_entry_id,
71 bool did_create_new_entry,
72 const GURL& url, 70 const GURL& url,
73 ui::PageTransition transition) { 71 ui::PageTransition transition) {
74 TestDidNavigateWithReferrer(render_frame_host, 72 TestDidNavigateWithReferrer(render_frame_host,
75 page_id, 73 page_id,
76 nav_entry_id,
77 did_create_new_entry,
78 url, 74 url,
79 Referrer(), 75 Referrer(),
80 transition); 76 transition);
81 } 77 }
82 78
83 void TestWebContents::TestDidNavigateWithReferrer( 79 void TestWebContents::TestDidNavigateWithReferrer(
84 RenderFrameHost* render_frame_host, 80 RenderFrameHost* render_frame_host,
85 int page_id, 81 int page_id,
86 int nav_entry_id,
87 bool did_create_new_entry,
88 const GURL& url, 82 const GURL& url,
89 const Referrer& referrer, 83 const Referrer& referrer,
90 ui::PageTransition transition) { 84 ui::PageTransition transition) {
91 FrameHostMsg_DidCommitProvisionalLoad_Params params; 85 FrameHostMsg_DidCommitProvisionalLoad_Params params;
92 86
93 params.page_id = page_id; 87 params.page_id = page_id;
94 params.nav_entry_id = nav_entry_id;
95 params.url = url; 88 params.url = url;
96 params.referrer = referrer; 89 params.referrer = referrer;
97 params.transition = transition; 90 params.transition = transition;
98 params.redirects = std::vector<GURL>(); 91 params.redirects = std::vector<GURL>();
99 params.should_update_history = false; 92 params.should_update_history = false;
100 params.searchable_form_url = GURL(); 93 params.searchable_form_url = GURL();
101 params.searchable_form_encoding = std::string(); 94 params.searchable_form_encoding = std::string();
102 params.did_create_new_entry = did_create_new_entry;
103 params.security_info = std::string(); 95 params.security_info = std::string();
104 params.gesture = NavigationGestureUser; 96 params.gesture = NavigationGestureUser;
105 params.was_within_same_page = false; 97 params.was_within_same_page = false;
106 params.is_post = false; 98 params.is_post = false;
107 params.page_state = PageState::CreateFromURL(url); 99 params.page_state = PageState::CreateFromURL(url);
108 100
109 RenderFrameHostImpl* rfhi = 101 RenderFrameHostImpl* rfhi =
110 static_cast<RenderFrameHostImpl*>(render_frame_host); 102 static_cast<RenderFrameHostImpl*>(render_frame_host);
111 rfhi->frame_tree_node()->navigator()->DidNavigate(rfhi, params); 103 rfhi->frame_tree_node()->navigator()->DidNavigate(rfhi, params);
112 } 104 }
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 TestRenderFrameHost* rfh = GetPendingMainFrame(); 175 TestRenderFrameHost* rfh = GetPendingMainFrame();
184 if (!rfh) 176 if (!rfh)
185 rfh = old_rfh; 177 rfh = old_rfh;
186 178
187 int page_id = entry->GetPageID(); 179 int page_id = entry->GetPageID();
188 if (page_id == -1) { 180 if (page_id == -1) {
189 // It's a new navigation, assign a never-seen page id to it. 181 // It's a new navigation, assign a never-seen page id to it.
190 page_id = GetMaxPageIDForSiteInstance(rfh->GetSiteInstance()) + 1; 182 page_id = GetMaxPageIDForSiteInstance(rfh->GetSiteInstance()) + 1;
191 } 183 }
192 184
193 rfh->SendNavigate(page_id, entry->GetUniqueID(), 185 rfh->SendNavigate(page_id, entry->GetURL());
194 GetController().GetPendingEntryIndex() == -1,
195 entry->GetURL());
196 // Simulate the SwapOut_ACK. This is needed when cross-site navigation 186 // Simulate the SwapOut_ACK. This is needed when cross-site navigation
197 // happens. 187 // happens.
198 if (old_rfh != rfh) 188 if (old_rfh != rfh)
199 old_rfh->OnSwappedOut(); 189 old_rfh->OnSwappedOut();
200 } 190 }
201 191
202 void TestWebContents::ProceedWithCrossSiteNavigation() { 192 void TestWebContents::ProceedWithCrossSiteNavigation() {
203 if (!GetPendingMainFrame()) 193 if (!GetPendingMainFrame())
204 return; 194 return;
205 GetMainFrame()->SendBeforeUnloadACK(true); 195 GetMainFrame()->SendBeforeUnloadACK(true);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 } 269 }
280 270
281 void TestWebContents::ShowCreatedWidget(int route_id, 271 void TestWebContents::ShowCreatedWidget(int route_id,
282 const gfx::Rect& initial_rect) { 272 const gfx::Rect& initial_rect) {
283 } 273 }
284 274
285 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) { 275 void TestWebContents::ShowCreatedFullscreenWidget(int route_id) {
286 } 276 }
287 277
288 } // namespace content 278 } // namespace content
OLDNEW
« no previous file with comments | « content/test/test_web_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698