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

Unified Diff: net/quic/core/quic_bandwidth_test.cc

Issue 2308043003: Landing Recent QUIC changes until 5:55 PM, Aug 25, 2016 UTC-4 (Closed)
Patch Set: Fixes for various tests Created 4 years, 3 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/quic/core/quic_bandwidth.h ('k') | net/quic/core/quic_buffered_packet_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/quic_bandwidth_test.cc
diff --git a/net/quic/core/quic_bandwidth_test.cc b/net/quic/core/quic_bandwidth_test.cc
index 78fac500581437024bb449a91e5317f20ea32370..d249768eb8a030987db409b0461c67b16f313d7e 100644
--- a/net/quic/core/quic_bandwidth_test.cc
+++ b/net/quic/core/quic_bandwidth_test.cc
@@ -63,6 +63,12 @@ TEST_F(QuicBandwidthTest, Scale) {
0.75f * QuicBandwidth::FromKBytesPerSecond(1000));
EXPECT_EQ(QuicBandwidth::FromKBytesPerSecond(1250),
QuicBandwidth::FromKBytesPerSecond(1000) * 1.25f);
+
+ // Ensure we are rounding correctly within a 1bps level of precision.
+ EXPECT_EQ(QuicBandwidth::FromBitsPerSecond(5),
+ QuicBandwidth::FromBitsPerSecond(9) * 0.5f);
+ EXPECT_EQ(QuicBandwidth::FromBitsPerSecond(2),
+ QuicBandwidth::FromBitsPerSecond(12) * 0.2f);
}
TEST_F(QuicBandwidthTest, BytesPerPeriod) {
« no previous file with comments | « net/quic/core/quic_bandwidth.h ('k') | net/quic/core/quic_buffered_packet_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698