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

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

Issue 1305293004: Notfiy NQE of QUIC RTT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated with more comments and tests Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_connection.h" 5 #include "net/quic/quic_connection.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 using testing::InSequence; 46 using testing::InSequence;
47 using testing::InvokeWithoutArgs; 47 using testing::InvokeWithoutArgs;
48 using testing::NiceMock; 48 using testing::NiceMock;
49 using testing::Ref; 49 using testing::Ref;
50 using testing::Return; 50 using testing::Return;
51 using testing::SaveArg; 51 using testing::SaveArg;
52 using testing::StrictMock; 52 using testing::StrictMock;
53 using testing::_; 53 using testing::_;
54 54
55 namespace net { 55 namespace net {
56
57 class SocketPerformanceWatcher;
58
56 namespace test { 59 namespace test {
57 namespace { 60 namespace {
58 61
59 const char data1[] = "foo"; 62 const char data1[] = "foo";
60 const char data2[] = "bar"; 63 const char data2[] = "bar";
61 64
62 const bool kFin = true; 65 const bool kFin = true;
63 const bool kEntropyFlag = true; 66 const bool kEntropyFlag = true;
64 67
65 const QuicPacketEntropyHash kTestEntropyHash = 76; 68 const QuicPacketEntropyHash kTestEntropyHash = 76;
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 const PacketWriterFactory& factory, 397 const PacketWriterFactory& factory,
395 Perspective perspective, 398 Perspective perspective,
396 QuicVersion version) 399 QuicVersion version)
397 : QuicConnection(connection_id, 400 : QuicConnection(connection_id,
398 address, 401 address,
399 helper, 402 helper,
400 factory, 403 factory,
401 /* owns_writer= */ false, 404 /* owns_writer= */ false,
402 perspective, 405 perspective,
403 /* is_secure= */ false, 406 /* is_secure= */ false,
404 SupportedVersions(version)) { 407 SupportedVersions(version),
408 scoped_ptr<SocketPerformanceWatcher>()) {
405 // Disable tail loss probes for most tests. 409 // Disable tail loss probes for most tests.
406 QuicSentPacketManagerPeer::SetMaxTailLossProbes( 410 QuicSentPacketManagerPeer::SetMaxTailLossProbes(
407 QuicConnectionPeer::GetSentPacketManager(this), 0); 411 QuicConnectionPeer::GetSentPacketManager(this), 0);
408 writer()->set_perspective(perspective); 412 writer()->set_perspective(perspective);
409 } 413 }
410 414
411 void SendAck() { 415 void SendAck() {
412 QuicConnectionPeer::SendAck(this); 416 QuicConnectionPeer::SendAck(this);
413 } 417 }
414 418
(...skipping 4290 matching lines...) Expand 10 before | Expand all | Expand 10 after
4705 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(1); 4709 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(1);
4706 connection_.SendGoAway(QUIC_PEER_GOING_AWAY, kHeadersStreamId, "Going Away."); 4710 connection_.SendGoAway(QUIC_PEER_GOING_AWAY, kHeadersStreamId, "Going Away.");
4707 EXPECT_TRUE(connection_.goaway_sent()); 4711 EXPECT_TRUE(connection_.goaway_sent());
4708 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(0); 4712 EXPECT_CALL(*send_algorithm_, OnPacketSent(_, _, _, _, _)).Times(0);
4709 connection_.SendGoAway(QUIC_PEER_GOING_AWAY, kHeadersStreamId, "Going Away."); 4713 connection_.SendGoAway(QUIC_PEER_GOING_AWAY, kHeadersStreamId, "Going Away.");
4710 } 4714 }
4711 4715
4712 } // namespace 4716 } // namespace
4713 } // namespace test 4717 } // namespace test
4714 } // namespace net 4718 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698