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

Side by Side Diff: net/quic/test_tools/quic_test_utils.cc

Issue 2497083002: Server push cancellation: clean up the code to make sure shared code is in sync with internal code. (Closed)
Patch Set: Created 4 years, 1 month 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/test_tools/quic_test_utils.h" 5 #include "net/quic/test_tools/quic_test_utils.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/sha1.h" 10 #include "base/sha1.h"
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 return new QuicCryptoServerStream(crypto_config, compressed_certs_cache, 436 return new QuicCryptoServerStream(crypto_config, compressed_certs_cache,
437 FLAGS_enable_quic_stateless_reject_support, 437 FLAGS_enable_quic_stateless_reject_support,
438 this, &helper_); 438 this, &helper_);
439 } 439 }
440 440
441 QuicCryptoServerStream* TestQuicSpdyServerSession::GetCryptoStream() { 441 QuicCryptoServerStream* TestQuicSpdyServerSession::GetCryptoStream() {
442 return static_cast<QuicCryptoServerStream*>( 442 return static_cast<QuicCryptoServerStream*>(
443 QuicServerSessionBase::GetCryptoStream()); 443 QuicServerSessionBase::GetCryptoStream());
444 } 444 }
445 445
446 TestPushPromiseDelegate::TestPushPromiseDelegate(bool match)
447 : match_(match), rendezvous_fired_(false), rendezvous_stream_(nullptr) {}
448
449 bool TestPushPromiseDelegate::CheckVary(
450 const SpdyHeaderBlock& client_request,
451 const SpdyHeaderBlock& promise_request,
452 const SpdyHeaderBlock& promise_response) {
453 DVLOG(1) << "match " << match_;
454 return match_;
455 }
456
457 void TestPushPromiseDelegate::OnRendezvousResult(QuicSpdyStream* stream) {
458 rendezvous_fired_ = true;
459 rendezvous_stream_ = stream;
460 }
461
446 TestQuicSpdyClientSession::TestQuicSpdyClientSession( 462 TestQuicSpdyClientSession::TestQuicSpdyClientSession(
447 QuicConnection* connection, 463 QuicConnection* connection,
448 const QuicConfig& config, 464 const QuicConfig& config,
449 const QuicServerId& server_id, 465 const QuicServerId& server_id,
450 QuicCryptoClientConfig* crypto_config) 466 QuicCryptoClientConfig* crypto_config)
451 : QuicClientSessionBase(connection, &push_promise_index_, config) { 467 : QuicClientSessionBase(connection, &push_promise_index_, config) {
452 crypto_stream_.reset(new QuicCryptoClientStream( 468 crypto_stream_.reset(new QuicCryptoClientStream(
453 server_id, this, CryptoTestUtils::ProofVerifyContextForTesting(), 469 server_id, this, CryptoTestUtils::ProofVerifyContextForTesting(),
454 crypto_config, this)); 470 crypto_config, this));
455 Initialize(); 471 Initialize();
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
926 // strike register worries that we've just overflowed a uint32_t time. 942 // strike register worries that we've just overflowed a uint32_t time.
927 (*server_connection)->AdvanceTime(connection_start_time); 943 (*server_connection)->AdvanceTime(connection_start_time);
928 } 944 }
929 945
930 QuicStreamId QuicClientDataStreamId(int i) { 946 QuicStreamId QuicClientDataStreamId(int i) {
931 return kClientDataStreamId1 + 2 * i; 947 return kClientDataStreamId1 + 2 * i;
932 } 948 }
933 949
934 } // namespace test 950 } // namespace test
935 } // namespace net 951 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/quic_test_utils.h ('k') | net/tools/quic/test_tools/push_promise_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698