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

Unified Diff: net/base/backoff_entry_unittest.cc

Issue 6966038: Anti-DDoS enhancements: Log to net log, UMA stats, improved policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head. Created 9 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 | « net/base/backoff_entry.cc ('k') | net/base/net_log_event_type_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/backoff_entry_unittest.cc
diff --git a/net/base/backoff_entry_unittest.cc b/net/base/backoff_entry_unittest.cc
index cad40a67da43bd487d5c351d22513dc2c644bc0b..320c9e3ff60d8603753423aaba007661f96e5d85 100644
--- a/net/base/backoff_entry_unittest.cc
+++ b/net/base/backoff_entry_unittest.cc
@@ -25,7 +25,7 @@ class TestBackoffEntry : public BackoffEntry {
virtual ~TestBackoffEntry() {}
- virtual TimeTicks GetTimeNow() const {
+ virtual TimeTicks ImplGetTimeNow() const OVERRIDE {
return now_;
}
@@ -108,29 +108,30 @@ TEST(BackoffEntryTest, ReleaseTimeCalculation) {
// With zero errors, should return "now".
TimeTicks result = entry.GetReleaseTime();
- EXPECT_EQ(entry.GetTimeNow(), result);
+ EXPECT_EQ(entry.ImplGetTimeNow(), result);
// 1 error.
entry.InformOfRequest(false);
result = entry.GetReleaseTime();
- EXPECT_EQ(entry.GetTimeNow() + TimeDelta::FromMilliseconds(1000), result);
+ EXPECT_EQ(entry.ImplGetTimeNow() + TimeDelta::FromMilliseconds(1000), result);
// 2 errors.
entry.InformOfRequest(false);
result = entry.GetReleaseTime();
- EXPECT_EQ(entry.GetTimeNow() + TimeDelta::FromMilliseconds(2000), result);
+ EXPECT_EQ(entry.ImplGetTimeNow() + TimeDelta::FromMilliseconds(2000), result);
// 3 errors.
entry.InformOfRequest(false);
result = entry.GetReleaseTime();
- EXPECT_EQ(entry.GetTimeNow() + TimeDelta::FromMilliseconds(4000), result);
+ EXPECT_EQ(entry.ImplGetTimeNow() + TimeDelta::FromMilliseconds(4000), result);
// 6 errors (to check it doesn't pass maximum).
entry.InformOfRequest(false);
entry.InformOfRequest(false);
entry.InformOfRequest(false);
result = entry.GetReleaseTime();
- EXPECT_EQ(entry.GetTimeNow() + TimeDelta::FromMilliseconds(20000), result);
+ EXPECT_EQ(
+ entry.ImplGetTimeNow() + TimeDelta::FromMilliseconds(20000), result);
}
TEST(BackoffEntryTest, ReleaseTimeCalculationWithJitter) {
@@ -144,8 +145,10 @@ TEST(BackoffEntryTest, ReleaseTimeCalculationWithJitter) {
entry.InformOfRequest(false);
entry.InformOfRequest(false);
TimeTicks result = entry.GetReleaseTime();
- EXPECT_LE(entry.GetTimeNow() + TimeDelta::FromMilliseconds(3200), result);
- EXPECT_GE(entry.GetTimeNow() + TimeDelta::FromMilliseconds(4000), result);
+ EXPECT_LE(
+ entry.ImplGetTimeNow() + TimeDelta::FromMilliseconds(3200), result);
+ EXPECT_GE(
+ entry.ImplGetTimeNow() + TimeDelta::FromMilliseconds(4000), result);
}
}
« no previous file with comments | « net/base/backoff_entry.cc ('k') | net/base/net_log_event_type_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698