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

Unified Diff: net/quic/core/crypto/chacha20_poly1305_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, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/crypto/chacha20_poly1305_decrypter_test.cc ('k') | net/quic/core/crypto/channel_id_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/crypto/chacha20_poly1305_encrypter_test.cc
diff --git a/net/quic/core/crypto/chacha20_poly1305_encrypter_test.cc b/net/quic/core/crypto/chacha20_poly1305_encrypter_test.cc
index f7c847a3bba4e3b97b9328b9cfb6286895c38883..544ad0a6a2223b50792c9303d25f16150363d093 100644
--- a/net/quic/core/crypto/chacha20_poly1305_encrypter_test.cc
+++ b/net/quic/core/crypto/chacha20_poly1305_encrypter_test.cc
@@ -8,6 +8,7 @@
#include "net/quic/core/crypto/chacha20_poly1305_decrypter.h"
#include "net/quic/core/quic_utils.h"
+#include "net/quic/platform/api/quic_test.h"
#include "net/quic/platform/api/quic_text_utils.h"
#include "net/quic/test_tools/quic_test_utils.h"
@@ -83,7 +84,9 @@ QuicData* EncryptWithNonce(ChaCha20Poly1305Encrypter* encrypter,
return new QuicData(ciphertext.release(), ciphertext_size, true);
}
-TEST(ChaCha20Poly1305EncrypterTest, EncryptThenDecrypt) {
+class ChaCha20Poly1305EncrypterTest : public QuicTest {};
+
+TEST_F(ChaCha20Poly1305EncrypterTest, EncryptThenDecrypt) {
ChaCha20Poly1305Encrypter encrypter;
ChaCha20Poly1305Decrypter decrypter;
@@ -108,7 +111,7 @@ TEST(ChaCha20Poly1305EncrypterTest, EncryptThenDecrypt) {
&len, arraysize(decrypted)));
}
-TEST(ChaCha20Poly1305EncrypterTest, Encrypt) {
+TEST_F(ChaCha20Poly1305EncrypterTest, Encrypt) {
for (size_t i = 0; test_vectors[i].key != nullptr; i++) {
// Decode the test vector.
string key = QuicTextUtils::HexDecode(test_vectors[i].key);
@@ -136,14 +139,14 @@ TEST(ChaCha20Poly1305EncrypterTest, Encrypt) {
}
}
-TEST(ChaCha20Poly1305EncrypterTest, GetMaxPlaintextSize) {
+TEST_F(ChaCha20Poly1305EncrypterTest, GetMaxPlaintextSize) {
ChaCha20Poly1305Encrypter encrypter;
EXPECT_EQ(1000u, encrypter.GetMaxPlaintextSize(1012));
EXPECT_EQ(100u, encrypter.GetMaxPlaintextSize(112));
EXPECT_EQ(10u, encrypter.GetMaxPlaintextSize(22));
}
-TEST(ChaCha20Poly1305EncrypterTest, GetCiphertextSize) {
+TEST_F(ChaCha20Poly1305EncrypterTest, GetCiphertextSize) {
ChaCha20Poly1305Encrypter encrypter;
EXPECT_EQ(1012u, encrypter.GetCiphertextSize(1000));
EXPECT_EQ(112u, encrypter.GetCiphertextSize(100));
« no previous file with comments | « net/quic/core/crypto/chacha20_poly1305_decrypter_test.cc ('k') | net/quic/core/crypto/channel_id_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698