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

Side by Side Diff: net/quic/core/crypto/null_encrypter_test.cc

Issue 2740453006: Add QuicStringPiece which is actually StringPiece. (Closed)
Patch Set: fix compile error and rebase Created 3 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
« no previous file with comments | « net/quic/core/crypto/null_encrypter.cc ('k') | net/quic/core/crypto/p256_key_exchange.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/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
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
OLDNEW
« no previous file with comments | « net/quic/core/crypto/null_encrypter.cc ('k') | net/quic/core/crypto/p256_key_exchange.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698