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

Unified Diff: net/url_request/url_request_throttler_simulation_unittest.cc

Issue 407093011: Allow URLRequests from one context to have different NetworkDelegates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new tests Created 6 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 side-by-side diff with in-line comments
Download patch
Index: net/url_request/url_request_throttler_simulation_unittest.cc
diff --git a/net/url_request/url_request_throttler_simulation_unittest.cc b/net/url_request/url_request_throttler_simulation_unittest.cc
index fc9dfde071188aed665ed8d623890428862a488c..14b20406a74fb0450332b6d592cff91b4658ef0c 100644
--- a/net/url_request/url_request_throttler_simulation_unittest.cc
+++ b/net/url_request/url_request_throttler_simulation_unittest.cc
@@ -21,6 +21,7 @@
#include "base/rand_util.h"
#include "base/time/time.h"
#include "net/base/request_priority.h"
+#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_test_util.h"
#include "net/url_request/url_request_throttler_manager.h"
#include "net/url_request/url_request_throttler_test_support.h"
@@ -275,6 +276,8 @@ class Server : public DiscreteTimeSimulation::Actor {
return output;
}
+ const URLRequestContext& context() const { return context_; }
+
private:
TimeTicks now_;
TimeTicks start_downtime_; // Can be 0 to say "no downtime".
@@ -427,7 +430,9 @@ class Requester : public DiscreteTimeSimulation::Actor {
if (throttler_entry_->fake_now() - time_of_last_attempt_ >
effective_delay) {
- if (!throttler_entry_->ShouldRejectRequest(server_->mock_request())) {
+ if (!throttler_entry_->ShouldRejectRequest(
+ server_->mock_request(),
+ server_->context().network_delegate())) {
int status_code = server_->HandleRequest();
MockURLRequestThrottlerHeaderAdapter response_headers(status_code);
throttler_entry_->UpdateWithResponse(std::string(), &response_headers);
« no previous file with comments | « net/url_request/url_request_throttler_entry_interface.h ('k') | net/url_request/url_request_throttler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698