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

Side by Side Diff: net/quic/core/quic_client_promised_info_test.cc

Issue 2408993002: Fix PushPromiseWaitCancels to call FireAlarm to cancel the promised stream instead of explicitly ca… (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698