OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/crypto/crypto_handshake_message.h" | 5 #include "net/quic/core/crypto/crypto_handshake_message.h" |
6 | 6 |
7 #include "net/quic/core/crypto/crypto_handshake.h" | 7 #include "net/quic/core/crypto/crypto_handshake.h" |
8 #include "net/quic/core/crypto/crypto_protocol.h" | 8 #include "net/quic/core/crypto/crypto_protocol.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "net/quic/platform/api/quic_test.h" |
10 | 10 |
11 namespace net { | 11 namespace net { |
12 namespace test { | 12 namespace test { |
13 namespace { | 13 namespace { |
14 | 14 |
15 class CryptoHandshakeMessageTest | 15 class CryptoHandshakeMessageTest : public QuicTestWithParam<Perspective> {}; |
16 : public ::testing::TestWithParam<Perspective> {}; | |
17 | 16 |
18 TEST_P(CryptoHandshakeMessageTest, DebugString) { | 17 TEST_P(CryptoHandshakeMessageTest, DebugString) { |
19 const char* str = "SHLO<\n>"; | 18 const char* str = "SHLO<\n>"; |
20 | 19 |
21 CryptoHandshakeMessage message; | 20 CryptoHandshakeMessage message; |
22 message.set_tag(kSHLO); | 21 message.set_tag(kSHLO); |
23 EXPECT_EQ(str, message.DebugString(GetParam())); | 22 EXPECT_EQ(str, message.DebugString(GetParam())); |
24 | 23 |
25 // Test copy | 24 // Test copy |
26 CryptoHandshakeMessage message2(message); | 25 CryptoHandshakeMessage message2(message); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 TEST_P(CryptoHandshakeMessageTest, HasStringPiece) { | 122 TEST_P(CryptoHandshakeMessageTest, HasStringPiece) { |
124 CryptoHandshakeMessage message; | 123 CryptoHandshakeMessage message; |
125 EXPECT_FALSE(message.HasStringPiece(kRCID)); | 124 EXPECT_FALSE(message.HasStringPiece(kRCID)); |
126 message.SetStringPiece(kRCID, "foo"); | 125 message.SetStringPiece(kRCID, "foo"); |
127 EXPECT_TRUE(message.HasStringPiece(kRCID)); | 126 EXPECT_TRUE(message.HasStringPiece(kRCID)); |
128 } | 127 } |
129 | 128 |
130 } // namespace | 129 } // namespace |
131 } // namespace test | 130 } // namespace test |
132 } // namespace net | 131 } // namespace net |
OLD | NEW |