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

Unified Diff: webrtc/base/ratelimiter_unittest.cc

Issue 2877023002: Move webrtc/{base => rtc_base} (Closed)
Patch Set: update presubmit.py and DEPS include rules Created 3 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
« no previous file with comments | « webrtc/base/ratelimiter.cc ('k') | webrtc/base/ratetracker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/ratelimiter_unittest.cc
diff --git a/webrtc/base/ratelimiter_unittest.cc b/webrtc/base/ratelimiter_unittest.cc
deleted file mode 100644
index b54a751b77e1b026dd6a54a2a6cdeb083c467482..0000000000000000000000000000000000000000
--- a/webrtc/base/ratelimiter_unittest.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2012 The WebRTC Project Authors. All rights reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "webrtc/base/gunit.h"
-#include "webrtc/base/ratelimiter.h"
-
-namespace rtc {
-
-TEST(RateLimiterTest, TestCanUse) {
- // Diet: Can eat 2,000 calories per day.
- RateLimiter limiter = RateLimiter(2000, 1.0);
-
- double monday = 1.0;
- double tuesday = 2.0;
- double thursday = 4.0;
-
- EXPECT_TRUE(limiter.CanUse(0, monday));
- EXPECT_TRUE(limiter.CanUse(1000, monday));
- EXPECT_TRUE(limiter.CanUse(1999, monday));
- EXPECT_TRUE(limiter.CanUse(2000, monday));
- EXPECT_FALSE(limiter.CanUse(2001, monday));
-
- limiter.Use(1000, monday);
-
- EXPECT_TRUE(limiter.CanUse(0, monday));
- EXPECT_TRUE(limiter.CanUse(999, monday));
- EXPECT_TRUE(limiter.CanUse(1000, monday));
- EXPECT_FALSE(limiter.CanUse(1001, monday));
-
- limiter.Use(1000, monday);
-
- EXPECT_TRUE(limiter.CanUse(0, monday));
- EXPECT_FALSE(limiter.CanUse(1, monday));
-
- EXPECT_TRUE(limiter.CanUse(0, tuesday));
- EXPECT_TRUE(limiter.CanUse(1, tuesday));
- EXPECT_TRUE(limiter.CanUse(1999, tuesday));
- EXPECT_TRUE(limiter.CanUse(2000, tuesday));
- EXPECT_FALSE(limiter.CanUse(2001, tuesday));
-
- limiter.Use(1000, tuesday);
-
- EXPECT_TRUE(limiter.CanUse(1000, tuesday));
- EXPECT_FALSE(limiter.CanUse(1001, tuesday));
-
- limiter.Use(1000, thursday);
-
- EXPECT_TRUE(limiter.CanUse(1000, tuesday));
- EXPECT_FALSE(limiter.CanUse(1001, tuesday));
-}
-
-} // namespace rtc
« no previous file with comments | « webrtc/base/ratelimiter.cc ('k') | webrtc/base/ratetracker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698