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

Unified Diff: net/url_request/url_request_throttler_simulation_unittest.cc

Issue 10440119: Introduce a delegate to avoid hardcoding "chrome-extension" in net/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to review requests. Created 8 years, 6 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 256d343f45e20b0e9e5c94de8dbc9c931d1bc015..a3b8ce0e68f1d5231e956d98e8f9264b0c91a117 100644
--- a/net/url_request/url_request_throttler_simulation_unittest.cc
+++ b/net/url_request/url_request_throttler_simulation_unittest.cc
@@ -159,7 +159,7 @@ class Server : public DiscreteTimeSimulation::Actor {
++num_current_tick_queries_;
if (!start_downtime_.is_null() &&
start_downtime_ < now_ && now_ < end_downtime_) {
- // TODO(joi): For the simulation measuring the increase in perceived
+ // For the simulation measuring the increase in perceived
// downtime, it might be interesting to count separately the
// queries seen by the server (assuming a front-end reverse proxy
// is what actually serves up the 503s in this case) so that we could
@@ -285,12 +285,6 @@ class Server : public DiscreteTimeSimulation::Actor {
DISALLOW_COPY_AND_ASSIGN(Server);
};
-class TestingURLRequestThrottlerManager : public URLRequestThrottlerManager {
- public:
- TestingURLRequestThrottlerManager() : URLRequestThrottlerManager() {
- }
-};
-
// Mock throttler entry used by Requester class.
class MockURLRequestThrottlerEntry : public URLRequestThrottlerEntry {
public:
@@ -427,7 +421,7 @@ class Requester : public DiscreteTimeSimulation::Actor {
if (throttler_entry_->fake_now() - time_of_last_attempt_ >
effective_delay) {
- if (!throttler_entry_->ShouldRejectRequest(0)) {
+ if (!throttler_entry_->ShouldRejectRequest(NULL, 0)) {
int status_code = server_->HandleRequest();
MockURLRequestThrottlerHeaderAdapter response_headers(status_code);
throttler_entry_->UpdateWithResponse("", &response_headers);
@@ -493,7 +487,7 @@ void SimulateAttack(Server* server,
const size_t kNumAttackers = 50;
const size_t kNumClients = 50;
DiscreteTimeSimulation simulation;
- TestingURLRequestThrottlerManager manager;
+ URLRequestThrottlerManager manager;
ScopedVector<Requester> requesters;
for (size_t i = 0; i < kNumAttackers; ++i) {
// Use a tiny time_between_requests so the attackers will ping the
@@ -596,7 +590,7 @@ double SimulateDowntime(const TimeDelta& duration,
Server server(std::numeric_limits<int>::max(), 1.0);
server.SetDowntime(start_downtime, duration);
- TestingURLRequestThrottlerManager manager;
+ URLRequestThrottlerManager manager;
scoped_refptr<MockURLRequestThrottlerEntry> throttler_entry(
new MockURLRequestThrottlerEntry(&manager));
if (!enable_throttling)

Powered by Google App Engine
This is Rietveld 408576698