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

Unified Diff: net/quic/quic_buffered_packet_store_test.cc

Issue 2125303002: Use overloaded operators with QuicTime for addition, subtraction and scalar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@126402784
Patch Set: Created 4 years, 5 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/quic_buffered_packet_store.cc ('k') | net/quic/quic_chromium_alarm_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_buffered_packet_store_test.cc
diff --git a/net/quic/quic_buffered_packet_store_test.cc b/net/quic/quic_buffered_packet_store_test.cc
index 84f22f0fd22f0d447d6fb684091b92f24b16993b..ba0b25f327b7c55e3d4b7969713f1773be26634c 100644
--- a/net/quic/quic_buffered_packet_store_test.cc
+++ b/net/quic/quic_buffered_packet_store_test.cc
@@ -59,8 +59,7 @@ class QuicBufferedPacketStoreTest : public ::testing::Test {
server_address_(Loopback6(), 65535),
client_address_(Loopback6(), 65535),
packet_content_("some encrypted content"),
- packet_time_(
- QuicTime::Zero().Add(QuicTime::Delta::FromMicroseconds(42))),
+ packet_time_(QuicTime::Zero() + QuicTime::Delta::FromMicroseconds(42)),
data_packet_(packet_content_.data(),
packet_content_.size(),
packet_time_) {}
@@ -190,9 +189,9 @@ TEST_F(QuicBufferedPacketStoreTest, PacketQueueExpiredBeforeDelivery) {
store_.EnqueuePacket(connection_id2, data_packet_, server_address_,
another_client_address);
// Advance clock to the time when connection 1 expires.
- clock_.AdvanceTime(QuicBufferedPacketStorePeer::expiration_alarm(&store_)
- ->deadline()
- .Subtract(clock_.ApproximateNow()));
+ clock_.AdvanceTime(
+ QuicBufferedPacketStorePeer::expiration_alarm(&store_)->deadline() -
+ clock_.ApproximateNow());
ASSERT_GE(clock_.ApproximateNow(),
QuicBufferedPacketStorePeer::expiration_alarm(&store_)->deadline());
// Fire alarm to remove long-staying connection 1 packets.
@@ -217,9 +216,9 @@ TEST_F(QuicBufferedPacketStoreTest, PacketQueueExpiredBeforeDelivery) {
client_address_);
store_.EnqueuePacket(connection_id3, data_packet_, server_address_,
client_address_);
- clock_.AdvanceTime(QuicBufferedPacketStorePeer::expiration_alarm(&store_)
- ->deadline()
- .Subtract(clock_.ApproximateNow()));
+ clock_.AdvanceTime(
+ QuicBufferedPacketStorePeer::expiration_alarm(&store_)->deadline() -
+ clock_.ApproximateNow());
alarm_factory_.FireAlarm(
QuicBufferedPacketStorePeer::expiration_alarm(&store_));
// |last_expired_packet_queue_| should be updated.
« no previous file with comments | « net/quic/quic_buffered_packet_store.cc ('k') | net/quic/quic_chromium_alarm_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698