OLD | NEW |
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/core/crypto/null_encrypter.h" | 5 #include "net/quic/core/crypto/null_encrypter.h" |
6 #include "net/quic/test_tools/quic_test_utils.h" | 6 #include "net/quic/test_tools/quic_test_utils.h" |
7 | 7 |
8 using base::StringPiece; | |
9 | |
10 namespace net { | 8 namespace net { |
11 namespace test { | 9 namespace test { |
12 | 10 |
13 class NullEncrypterTest : public ::testing::TestWithParam<bool> {}; | 11 class NullEncrypterTest : public ::testing::TestWithParam<bool> {}; |
14 | 12 |
15 TEST_F(NullEncrypterTest, EncryptClient) { | 13 TEST_F(NullEncrypterTest, EncryptClient) { |
16 unsigned char expected[] = { | 14 unsigned char expected[] = { |
17 // fnv hash | 15 // fnv hash |
18 0x97, 0xdc, 0x27, 0x2f, 0x18, 0xa8, 0x56, 0x73, 0xdf, 0x8d, 0x1d, 0xd0, | 16 0x97, 0xdc, 0x27, 0x2f, 0x18, 0xa8, 0x56, 0x73, 0xdf, 0x8d, 0x1d, 0xd0, |
19 // payload | 17 // payload |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 91 |
94 TEST_F(NullEncrypterTest, GetCiphertextSize) { | 92 TEST_F(NullEncrypterTest, GetCiphertextSize) { |
95 NullEncrypter encrypter(Perspective::IS_CLIENT); | 93 NullEncrypter encrypter(Perspective::IS_CLIENT); |
96 EXPECT_EQ(1012u, encrypter.GetCiphertextSize(1000)); | 94 EXPECT_EQ(1012u, encrypter.GetCiphertextSize(1000)); |
97 EXPECT_EQ(112u, encrypter.GetCiphertextSize(100)); | 95 EXPECT_EQ(112u, encrypter.GetCiphertextSize(100)); |
98 EXPECT_EQ(22u, encrypter.GetCiphertextSize(10)); | 96 EXPECT_EQ(22u, encrypter.GetCiphertextSize(10)); |
99 } | 97 } |
100 | 98 |
101 } // namespace test | 99 } // namespace test |
102 } // namespace net | 100 } // namespace net |
OLD | NEW |