| Index: net/quic/quic_connection_test.cc
|
| diff --git a/net/quic/quic_connection_test.cc b/net/quic/quic_connection_test.cc
|
| index a827bda89047145edb0bc7dfd7b7a9e3f78493ce..3487cd0c9a117d54c529d2c46483885656db7348 100644
|
| --- a/net/quic/quic_connection_test.cc
|
| +++ b/net/quic/quic_connection_test.cc
|
| @@ -3178,11 +3178,11 @@ TEST_F(QuicConnectionTest, AckNotifierTriggerCallback) {
|
| EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
|
|
|
| // Create a delegate which we expect to be called.
|
| - MockAckNotifierDelegate delegate;
|
| - EXPECT_CALL(delegate, OnAckNotification()).Times(1);;
|
| + scoped_refptr<MockAckNotifierDelegate> delegate(new MockAckNotifierDelegate);
|
| + EXPECT_CALL(*delegate, OnAckNotification()).Times(1);;
|
|
|
| // Send some data, which will register the delegate to be notified.
|
| - connection_.SendStreamDataWithString(1, "foo", 0, !kFin, &delegate);
|
| + connection_.SendStreamDataWithString(1, "foo", 0, !kFin, delegate.get());
|
|
|
| // Process an ACK from the server which should trigger the callback.
|
| EXPECT_CALL(*send_algorithm_, OnPacketAcked(_, _, _)).Times(1);
|
| @@ -3194,14 +3194,14 @@ TEST_F(QuicConnectionTest, AckNotifierFailToTriggerCallback) {
|
| EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
|
|
|
| // Create a delegate which we don't expect to be called.
|
| - MockAckNotifierDelegate delegate;
|
| - EXPECT_CALL(delegate, OnAckNotification()).Times(0);;
|
| + scoped_refptr<MockAckNotifierDelegate> delegate(new MockAckNotifierDelegate);
|
| + EXPECT_CALL(*delegate, OnAckNotification()).Times(0);;
|
|
|
| EXPECT_CALL(*send_algorithm_, OnPacketAcked(_, _, _)).Times(2);
|
|
|
| // Send some data, which will register the delegate to be notified. This will
|
| // not be ACKed and so the delegate should never be called.
|
| - connection_.SendStreamDataWithString(1, "foo", 0, !kFin, &delegate);
|
| + connection_.SendStreamDataWithString(1, "foo", 0, !kFin, delegate.get());
|
|
|
| // Send some other data which we will ACK.
|
| connection_.SendStreamDataWithString(1, "foo", 0, !kFin, NULL);
|
| @@ -3220,15 +3220,15 @@ TEST_F(QuicConnectionTest, AckNotifierCallbackAfterRetransmission) {
|
| EXPECT_CALL(visitor_, OnSuccessfulVersionNegotiation(_));
|
|
|
| // Create a delegate which we expect to be called.
|
| - MockAckNotifierDelegate delegate;
|
| - EXPECT_CALL(delegate, OnAckNotification()).Times(1);;
|
| + scoped_refptr<MockAckNotifierDelegate> delegate(new MockAckNotifierDelegate);
|
| + EXPECT_CALL(*delegate, OnAckNotification()).Times(1);;
|
|
|
| // In total expect ACKs for all 4 packets.
|
| EXPECT_CALL(*send_algorithm_, OnPacketAcked(_, _, _)).Times(4);
|
|
|
| // Send four packets, and register to be notified on ACK of packet 2.
|
| connection_.SendStreamDataWithString(1, "foo", 0, !kFin, NULL);
|
| - connection_.SendStreamDataWithString(1, "bar", 0, !kFin, &delegate);
|
| + connection_.SendStreamDataWithString(1, "bar", 0, !kFin, delegate.get());
|
| connection_.SendStreamDataWithString(1, "baz", 0, !kFin, NULL);
|
| connection_.SendStreamDataWithString(1, "qux", 0, !kFin, NULL);
|
|
|
| @@ -3253,14 +3253,14 @@ TEST_F(QuicConnectionTest, AckNotifierCallbackAfterFECRecovery) {
|
| EXPECT_CALL(visitor_, OnCanWrite()).Times(1).WillOnce(Return(true));
|
|
|
| // Create a delegate which we expect to be called.
|
| - MockAckNotifierDelegate delegate;
|
| - EXPECT_CALL(delegate, OnAckNotification()).Times(1);;
|
| + scoped_refptr<MockAckNotifierDelegate> delegate(new MockAckNotifierDelegate);
|
| + EXPECT_CALL(*delegate, OnAckNotification()).Times(1);;
|
|
|
| // Expect ACKs for 1 packet.
|
| EXPECT_CALL(*send_algorithm_, OnPacketAcked(_, _, _)).Times(1);
|
|
|
| // Send one packet, and register to be notified on ACK.
|
| - connection_.SendStreamDataWithString(1, "foo", 0, !kFin, &delegate);
|
| + connection_.SendStreamDataWithString(1, "foo", 0, !kFin, delegate.get());
|
|
|
| // Ack packet gets dropped, but we receive an FEC packet that covers it.
|
| // Should recover the Ack packet and trigger the notification callback.
|
|
|