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

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

Issue 12806002: Land Recent QUIC Changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: minor comment fix Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/quic_crypto_stream.cc ('k') | net/quic/quic_data_reader.h » ('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 <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
11 #include "net/quic/crypto/crypto_handshake.h"
11 #include "net/quic/test_tools/quic_test_utils.h" 12 #include "net/quic/test_tools/quic_test_utils.h"
12 #include "testing/gmock/include/gmock/gmock.h" 13 #include "testing/gmock/include/gmock/gmock.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 15
15 using std::string; 16 using std::string;
16 using std::vector; 17 using std::vector;
17 18
18 namespace net { 19 namespace net {
19 namespace test { 20 namespace test {
20 namespace { 21 namespace {
(...skipping 16 matching lines...) Expand all
37 private: 38 private:
38 vector<CryptoHandshakeMessage> messages_; 39 vector<CryptoHandshakeMessage> messages_;
39 40
40 DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoStream); 41 DISALLOW_COPY_AND_ASSIGN(MockQuicCryptoStream);
41 }; 42 };
42 43
43 class QuicCryptoStreamTest : public ::testing::Test { 44 class QuicCryptoStreamTest : public ::testing::Test {
44 public: 45 public:
45 QuicCryptoStreamTest() 46 QuicCryptoStreamTest()
46 : addr_(IPAddressNumber(), 1), 47 : addr_(IPAddressNumber(), 1),
47 connection_(new MockConnection(1, addr_)), 48 connection_(new MockConnection(1, addr_, false)),
48 session_(connection_, true), 49 session_(connection_, true),
49 stream_(&session_) { 50 stream_(&session_) {
50 message_.tag = kSHLO; 51 message_.tag = kSHLO;
51 message_.tag_value_map[1] = "abc"; 52 message_.tag_value_map[1] = "abc";
52 message_.tag_value_map[2] = "def"; 53 message_.tag_value_map[2] = "def";
53 ConstructHandshakeMessage(); 54 ConstructHandshakeMessage();
54 } 55 }
55 56
56 void ConstructHandshakeMessage() { 57 void ConstructHandshakeMessage() {
57 CryptoFramer framer; 58 CryptoFramer framer;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 bad[6] = 0x7F; // out of order tag 97 bad[6] = 0x7F; // out of order tag
97 98
98 EXPECT_CALL(*connection_, 99 EXPECT_CALL(*connection_,
99 SendConnectionClose(QUIC_CRYPTO_TAGS_OUT_OF_ORDER)); 100 SendConnectionClose(QUIC_CRYPTO_TAGS_OUT_OF_ORDER));
100 EXPECT_EQ(0u, stream_.ProcessData(bad.data(), bad.length())); 101 EXPECT_EQ(0u, stream_.ProcessData(bad.data(), bad.length()));
101 } 102 }
102 103
103 } // namespace 104 } // namespace
104 } // namespace test 105 } // namespace test
105 } // namespace net 106 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_crypto_stream.cc ('k') | net/quic/quic_data_reader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698