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

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

Issue 1905843003: Split out QuicAlarm creation from QuicConnectionHelper to new QuicAlarmFactory. No behavior change,… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@119753783
Patch Set: Rebase Created 4 years, 8 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 | « net/quic/quic_crypto_server_stream_test.cc ('k') | net/quic/quic_flow_controller_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_crypto_stream.h" 5 #include "net/quic/quic_crypto_stream.h"
6 6
7 #include <cstdint> 7 #include <cstdint>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 27 matching lines...) Expand all
38 38
39 private: 39 private:
40 vector<CryptoHandshakeMessage> messages_; 40 vector<CryptoHandshakeMessage> messages_;
41 41
42 DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoStream); 42 DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoStream);
43 }; 43 };
44 44
45 class QuicCryptoStreamTest : public ::testing::Test { 45 class QuicCryptoStreamTest : public ::testing::Test {
46 public: 46 public:
47 QuicCryptoStreamTest() 47 QuicCryptoStreamTest()
48 : connection_(new MockConnection(&helper_, Perspective::IS_CLIENT)), 48 : connection_(new MockConnection(&helper_,
49 &alarm_factory_,
50 Perspective::IS_CLIENT)),
49 session_(connection_), 51 session_(connection_),
50 stream_(&session_) { 52 stream_(&session_) {
51 message_.set_tag(kSHLO); 53 message_.set_tag(kSHLO);
52 message_.SetStringPiece(1, "abc"); 54 message_.SetStringPiece(1, "abc");
53 message_.SetStringPiece(2, "def"); 55 message_.SetStringPiece(2, "def");
54 ConstructHandshakeMessage(); 56 ConstructHandshakeMessage();
55 } 57 }
56 58
57 void ConstructHandshakeMessage() { 59 void ConstructHandshakeMessage() {
58 CryptoFramer framer; 60 CryptoFramer framer;
59 message_data_.reset(framer.ConstructHandshakeMessage(message_)); 61 message_data_.reset(framer.ConstructHandshakeMessage(message_));
60 } 62 }
61 63
62 protected: 64 protected:
63 MockConnectionHelper helper_; 65 MockConnectionHelper helper_;
66 MockAlarmFactory alarm_factory_;
64 MockConnection* connection_; 67 MockConnection* connection_;
65 MockQuicSpdySession session_; 68 MockQuicSpdySession session_;
66 MockQuicCryptoStream stream_; 69 MockQuicCryptoStream stream_;
67 CryptoHandshakeMessage message_; 70 CryptoHandshakeMessage message_;
68 std::unique_ptr<QuicData> message_data_; 71 std::unique_ptr<QuicData> message_data_;
69 72
70 private: 73 private:
71 DISALLOW_COPY_AND_ASSIGN(QuicCryptoStreamTest); 74 DISALLOW_COPY_AND_ASSIGN(QuicCryptoStreamTest);
72 }; 75 };
73 76
(...skipping 29 matching lines...) Expand all
103 } 106 }
104 107
105 TEST_F(QuicCryptoStreamTest, NoConnectionLevelFlowControl) { 108 TEST_F(QuicCryptoStreamTest, NoConnectionLevelFlowControl) {
106 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl( 109 EXPECT_FALSE(ReliableQuicStreamPeer::StreamContributesToConnectionFlowControl(
107 &stream_)); 110 &stream_));
108 } 111 }
109 112
110 } // namespace 113 } // namespace
111 } // namespace test 114 } // namespace test
112 } // namespace net 115 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_crypto_server_stream_test.cc ('k') | net/quic/quic_flow_controller_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698