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

Unified Diff: content/public/test/navigation_simulator.cc

Issue 2885453003: NavigationSimulator: add support for GlobalRequestIds (Closed)
Patch Set: fix comments Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/page_load_metrics/page_load_tracker.cc ('k') | content/test/test_navigation_url_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/navigation_simulator.cc
diff --git a/content/public/test/navigation_simulator.cc b/content/public/test/navigation_simulator.cc
index 3530e615c36ffc798ed6ea973f01fec0eea03410..bf2995e4f2fdf17b6ab95c23b02c56dfe4fd1112 100644
--- a/content/public/test/navigation_simulator.cc
+++ b/content/public/test/navigation_simulator.cc
@@ -10,6 +10,7 @@
#include "content/browser/frame_host/navigation_handle_impl.h"
#include "content/browser/frame_host/navigation_request.h"
#include "content/common/frame_messages.h"
+#include "content/public/browser/global_request_id.h"
#include "content/public/browser/navigation_throttle.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/browser_side_navigation_policy.h"
@@ -251,9 +252,15 @@ void NavigationSimulator::Commit() {
// Note that the handle's state can be CANCELING if a throttle cancelled it
// synchronously in PrepareForCommit.
if (handle_->state_for_testing() < NavigationHandleImpl::CANCELING) {
+ // Start the request_ids at 1000 to avoid collisions with request ids from
+ // network resources (it should be rare to compare these in unit tests).
+ static int request_id = 1000;
+ GlobalRequestID global_id(render_frame_host_->GetProcess()->GetID(),
+ ++request_id);
+ DCHECK(!IsBrowserSideNavigationEnabled());
handle_->WillProcessResponse(
render_frame_host_, scoped_refptr<net::HttpResponseHeaders>(),
- net::HttpResponseInfo::ConnectionInfo(), SSLStatus(), GlobalRequestID(),
+ net::HttpResponseInfo::ConnectionInfo(), SSLStatus(), global_id,
false /* should_replace_current_entry */, false /* is_download */,
false /* is_stream */, base::Closure(),
base::Callback<void(NavigationThrottle::ThrottleCheckResult)>());
« no previous file with comments | « chrome/browser/page_load_metrics/page_load_tracker.cc ('k') | content/test/test_navigation_url_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698