Chromium Code Reviews| 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..61d250983016a770459caddc1be8435325293094 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 resoures (it should be rare to compare these in unit tests). |
|
arthursonzogni
2017/05/16 09:16:04
Nit: s/resoures/resources
Charlie Harrison
2017/05/16 12:23:39
Done.
|
| + 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)>()); |