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

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

Issue 2132603002: [page_load_metrics] Add a NavigationThrottle for richer abort metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nasko@ nits Created 4 years, 4 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
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 "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"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 CHECK(!browser_side_navigation || rfh->is_loading()); 246 CHECK(!browser_side_navigation || rfh->is_loading());
247 CHECK(!browser_side_navigation || 247 CHECK(!browser_side_navigation ||
248 !rfh->frame_tree_node()->navigation_request()); 248 !rfh->frame_tree_node()->navigation_request());
249 249
250 int page_id = entry->GetPageID(); 250 int page_id = entry->GetPageID();
251 if (page_id == -1) { 251 if (page_id == -1) {
252 // It's a new navigation, assign a never-seen page id to it. 252 // It's a new navigation, assign a never-seen page id to it.
253 page_id = GetMaxPageIDForSiteInstance(rfh->GetSiteInstance()) + 1; 253 page_id = GetMaxPageIDForSiteInstance(rfh->GetSiteInstance()) + 1;
254 } 254 }
255 255
256 rfh->SendNavigate(page_id, entry->GetUniqueID(), 256 rfh->SendNavigateWithTransition(page_id, entry->GetUniqueID(),
257 GetController().GetPendingEntryIndex() == -1, 257 GetController().GetPendingEntryIndex() == -1,
258 entry->GetURL()); 258 entry->GetURL(), entry->GetTransitionType());
259 // Simulate the SwapOut_ACK. This is needed when cross-site navigation 259 // Simulate the SwapOut_ACK. This is needed when cross-site navigation
260 // happens. 260 // happens.
261 if (old_rfh != rfh) 261 if (old_rfh != rfh)
262 old_rfh->OnSwappedOut(); 262 old_rfh->OnSwappedOut();
263 } 263 }
264 264
265 void TestWebContents::ProceedWithCrossSiteNavigation() { 265 void TestWebContents::ProceedWithCrossSiteNavigation() {
266 if (!GetPendingMainFrame()) 266 if (!GetPendingMainFrame())
267 return; 267 return;
268 GetMainFrame()->SendBeforeUnloadACK(true); 268 GetMainFrame()->SendBeforeUnloadACK(true);
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 int route_id) { 356 int route_id) {
357 } 357 }
358 358
359 void TestWebContents::SaveFrameWithHeaders(const GURL& url, 359 void TestWebContents::SaveFrameWithHeaders(const GURL& url,
360 const Referrer& referrer, 360 const Referrer& referrer,
361 const std::string& headers) { 361 const std::string& headers) {
362 save_frame_headers_ = headers; 362 save_frame_headers_ = headers;
363 } 363 }
364 364
365 } // namespace content 365 } // namespace content
OLDNEW
« no previous file with comments | « content/test/content_browser_test_utils_internal.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698