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

Side by Side Diff: net/quic/quic_sent_packet_manager_test.cc

Issue 353903003: Changes congestion-options used in the config to a more general (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_sent_packet_manager.cc ('k') | net/quic/test_tools/quic_config_peer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_sent_packet_manager.h" 5 #include "net/quic/quic_sent_packet_manager.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "net/quic/quic_flags.h" 8 #include "net/quic/quic_flags.h"
9 #include "net/quic/test_tools/quic_config_peer.h" 9 #include "net/quic/test_tools/quic_config_peer.h"
10 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h" 10 #include "net/quic/test_tools/quic_sent_packet_manager_peer.h"
(...skipping 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 } 1323 }
1324 1324
1325 TEST_F(QuicSentPacketManagerTest, NegotiateTimeLossDetectionFromOptions) { 1325 TEST_F(QuicSentPacketManagerTest, NegotiateTimeLossDetectionFromOptions) {
1326 EXPECT_EQ(kNack, 1326 EXPECT_EQ(kNack,
1327 QuicSentPacketManagerPeer::GetLossAlgorithm( 1327 QuicSentPacketManagerPeer::GetLossAlgorithm(
1328 &manager_)->GetLossDetectionType()); 1328 &manager_)->GetLossDetectionType());
1329 1329
1330 QuicConfig config; 1330 QuicConfig config;
1331 QuicTagVector options; 1331 QuicTagVector options;
1332 options.push_back(kTIME); 1332 options.push_back(kTIME);
1333 QuicConfigPeer::SetReceivedCongestionOptions(&config, options); 1333 QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
1334 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _)); 1334 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
1335 manager_.SetFromConfig(config); 1335 manager_.SetFromConfig(config);
1336 1336
1337 EXPECT_EQ(kTime, 1337 EXPECT_EQ(kTime,
1338 QuicSentPacketManagerPeer::GetLossAlgorithm( 1338 QuicSentPacketManagerPeer::GetLossAlgorithm(
1339 &manager_)->GetLossDetectionType()); 1339 &manager_)->GetLossDetectionType());
1340 } 1340 }
1341 1341
1342 TEST_F(QuicSentPacketManagerTest, NegotiatePacingFromOptions) { 1342 TEST_F(QuicSentPacketManagerTest, NegotiatePacingFromOptions) {
1343 ValueRestore<bool> old_flag(&FLAGS_enable_quic_pacing, true); 1343 ValueRestore<bool> old_flag(&FLAGS_enable_quic_pacing, true);
1344 EXPECT_FALSE(manager_.using_pacing()); 1344 EXPECT_FALSE(manager_.using_pacing());
1345 1345
1346 QuicConfig config; 1346 QuicConfig config;
1347 QuicTagVector options; 1347 QuicTagVector options;
1348 options.push_back(kPACE); 1348 options.push_back(kPACE);
1349 QuicConfigPeer::SetReceivedCongestionOptions(&config, options); 1349 QuicConfigPeer::SetReceivedConnectionOptions(&config, options);
1350 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _)); 1350 EXPECT_CALL(*send_algorithm_, SetFromConfig(_, _));
1351 manager_.SetFromConfig(config); 1351 manager_.SetFromConfig(config);
1352 1352
1353 EXPECT_TRUE(manager_.using_pacing()); 1353 EXPECT_TRUE(manager_.using_pacing());
1354 } 1354 }
1355 1355
1356 } // namespace 1356 } // namespace
1357 } // namespace test 1357 } // namespace test
1358 } // namespace net 1358 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_sent_packet_manager.cc ('k') | net/quic/test_tools/quic_config_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698