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

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

Issue 2848203002: Add a platform implementation of QuicTest and QuicTestWithParam (Closed)
Patch Set: net/quic/platform/impl/quic_test_impl.cc Created 3 years, 7 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
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/platform/api/quic_test.h"
6 #include "net/quic/test_tools/quic_test_utils.h" 7 #include "net/quic/test_tools/quic_test_utils.h"
7 8
8 namespace net { 9 namespace net {
9 namespace test { 10 namespace test {
10 11
11 class NullEncrypterTest : public ::testing::TestWithParam<bool> {}; 12 class NullEncrypterTest : public QuicTestWithParam<bool> {};
12 13
13 TEST_F(NullEncrypterTest, EncryptClient) { 14 TEST_F(NullEncrypterTest, EncryptClient) {
14 unsigned char expected[] = { 15 unsigned char expected[] = {
15 // fnv hash 16 // fnv hash
16 0x97, 0xdc, 0x27, 0x2f, 0x18, 0xa8, 0x56, 0x73, 0xdf, 0x8d, 0x1d, 0xd0, 17 0x97, 0xdc, 0x27, 0x2f, 0x18, 0xa8, 0x56, 0x73, 0xdf, 0x8d, 0x1d, 0xd0,
17 // payload 18 // payload
18 'g', 'o', 'o', 'd', 'b', 'y', 'e', '!', 19 'g', 'o', 'o', 'd', 'b', 'y', 'e', '!',
19 }; 20 };
20 char encrypted[256]; 21 char encrypted[256];
21 size_t encrypted_len = 0; 22 size_t encrypted_len = 0;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 92
92 TEST_F(NullEncrypterTest, GetCiphertextSize) { 93 TEST_F(NullEncrypterTest, GetCiphertextSize) {
93 NullEncrypter encrypter(Perspective::IS_CLIENT); 94 NullEncrypter encrypter(Perspective::IS_CLIENT);
94 EXPECT_EQ(1012u, encrypter.GetCiphertextSize(1000)); 95 EXPECT_EQ(1012u, encrypter.GetCiphertextSize(1000));
95 EXPECT_EQ(112u, encrypter.GetCiphertextSize(100)); 96 EXPECT_EQ(112u, encrypter.GetCiphertextSize(100));
96 EXPECT_EQ(22u, encrypter.GetCiphertextSize(10)); 97 EXPECT_EQ(22u, encrypter.GetCiphertextSize(10));
97 } 98 }
98 99
99 } // namespace test 100 } // namespace test
100 } // namespace net 101 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/crypto/null_decrypter_test.cc ('k') | net/quic/core/crypto/p256_key_exchange_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698