| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/core/quic_client_promised_info.h" | 5 #include "net/quic/core/quic_client_promised_info.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "net/quic/core/spdy_utils.h" | 10 #include "net/quic/core/spdy_utils.h" |
| (...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 // Promise is still there, waiting for response. | 302 // Promise is still there, waiting for response. |
| 303 EXPECT_NE(session_.GetPromisedById(promise_id_), nullptr); | 303 EXPECT_NE(session_.GetPromisedById(promise_id_), nullptr); |
| 304 | 304 |
| 305 // Create response stream, but no data yet. | 305 // Create response stream, but no data yet. |
| 306 session_.GetOrCreateStream(promise_id_); | 306 session_.GetOrCreateStream(promise_id_); |
| 307 | 307 |
| 308 // Fire the alarm that will cancel the promised stream. | 308 // Fire the alarm that will cancel the promised stream. |
| 309 EXPECT_CALL(session_, CloseStream(promise_id_)); | 309 EXPECT_CALL(session_, CloseStream(promise_id_)); |
| 310 EXPECT_CALL(*connection_, | 310 EXPECT_CALL(*connection_, |
| 311 SendRstStream(promise_id_, QUIC_STREAM_CANCELLED, 0)); | 311 SendRstStream(promise_id_, QUIC_STREAM_CANCELLED, 0)); |
| 312 promised->Cancel(); | 312 alarm_factory_.FireAlarm(QuicClientPromisedInfoPeer::GetAlarm(promised)); |
| 313 | 313 |
| 314 // Promise is gone | 314 // Promise is gone |
| 315 EXPECT_EQ(session_.GetPromisedById(promise_id_), nullptr); | 315 EXPECT_EQ(session_.GetPromisedById(promise_id_), nullptr); |
| 316 } | 316 } |
| 317 | 317 |
| 318 TEST_F(QuicClientPromisedInfoTest, PushPromiseDataClosed) { | 318 TEST_F(QuicClientPromisedInfoTest, PushPromiseDataClosed) { |
| 319 ReceivePromise(promise_id_); | 319 ReceivePromise(promise_id_); |
| 320 | 320 |
| 321 QuicClientPromisedInfo* promised = session_.GetPromisedById(promise_id_); | 321 QuicClientPromisedInfo* promised = session_.GetPromisedById(promise_id_); |
| 322 ASSERT_NE(promised, nullptr); | 322 ASSERT_NE(promised, nullptr); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 344 EXPECT_FALSE(delegate.rendezvous_fired()); | 344 EXPECT_FALSE(delegate.rendezvous_fired()); |
| 345 EXPECT_EQ(delegate.rendezvous_stream(), nullptr); | 345 EXPECT_EQ(delegate.rendezvous_stream(), nullptr); |
| 346 | 346 |
| 347 // Promise is gone | 347 // Promise is gone |
| 348 EXPECT_EQ(session_.GetPromisedById(promise_id_), nullptr); | 348 EXPECT_EQ(session_.GetPromisedById(promise_id_), nullptr); |
| 349 } | 349 } |
| 350 | 350 |
| 351 } // namespace | 351 } // namespace |
| 352 } // namespace test | 352 } // namespace test |
| 353 } // namespace net | 353 } // namespace net |
| OLD | NEW |