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

Unified Diff: net/url_request/url_request_throttler_unittest.cc

Issue 6932013: Fix logic for handling reports of malformed bodies. To end up counting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix bug Sanjeev pointed out. Created 9 years, 8 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_unittest.cc
diff --git a/net/url_request/url_request_throttler_unittest.cc b/net/url_request/url_request_throttler_unittest.cc
index 5f8f2eee720756de0181ef4dec9a66b9fd1f8f83..f6227b32ebabfbfec6c9a481b9ce5251b17180a7 100644
--- a/net/url_request/url_request_throttler_unittest.cc
+++ b/net/url_request/url_request_throttler_unittest.cc
@@ -325,8 +325,13 @@ TEST_F(URLRequestThrottlerEntryTest, MalformedContent) {
TimeTicks release_after_failures = entry_->GetExponentialBackoffReleaseTime();
// Inform the entry that a response body was malformed, which is supposed to
- // increase the back-off time.
+ // increase the back-off time. Note that we also submit a successful
+ // UpdateWithResponse to pair with ReceivedContentWasMalformed() since that
+ // is what happens in practice (if a body is received, then a non-500
+ // response must also have been received).
entry_->ReceivedContentWasMalformed();
+ MockURLRequestThrottlerHeaderAdapter success_adapter(200);
+ entry_->UpdateWithResponse("", &success_adapter);
EXPECT_GT(entry_->GetExponentialBackoffReleaseTime(), release_after_failures);
}
« net/base/backoff_entry.cc ('K') | « net/url_request/url_request_throttler_entry.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698