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

Unified Diff: net/quic/core/crypto/null_decrypter_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/core/crypto/null_decrypter.cc ('k') | net/quic/core/crypto/null_encrypter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/crypto/null_decrypter_test.cc
diff --git a/net/quic/core/crypto/null_decrypter_test.cc b/net/quic/core/crypto/null_decrypter_test.cc
index c70964ca0034763d9144772b2df089ba58ba3b53..10f4c31b208f2b71678cb2b420aa6bd267a4fa63 100644
--- a/net/quic/core/crypto/null_decrypter_test.cc
+++ b/net/quic/core/crypto/null_decrypter_test.cc
@@ -5,8 +5,6 @@
#include "net/quic/core/crypto/null_decrypter.h"
#include "net/quic/test_tools/quic_test_utils.h"
-using base::StringPiece;
-
namespace net {
namespace test {
@@ -25,10 +23,10 @@ TEST_F(NullDecrypterTest, DecryptClient) {
char buffer[256];
size_t length = 0;
ASSERT_TRUE(decrypter.DecryptPacket(QUIC_VERSION_37, 0, "hello world!",
- StringPiece(data, len), buffer, &length,
- 256));
+ QuicStringPiece(data, len), buffer,
+ &length, 256));
EXPECT_LT(0u, length);
- EXPECT_EQ("goodbye!", StringPiece(buffer, length));
+ EXPECT_EQ("goodbye!", QuicStringPiece(buffer, length));
}
TEST_F(NullDecrypterTest, DecryptServer) {
@@ -44,10 +42,10 @@ TEST_F(NullDecrypterTest, DecryptServer) {
char buffer[256];
size_t length = 0;
ASSERT_TRUE(decrypter.DecryptPacket(QUIC_VERSION_37, 0, "hello world!",
- StringPiece(data, len), buffer, &length,
- 256));
+ QuicStringPiece(data, len), buffer,
+ &length, 256));
EXPECT_LT(0u, length);
- EXPECT_EQ("goodbye!", StringPiece(buffer, length));
+ EXPECT_EQ("goodbye!", QuicStringPiece(buffer, length));
}
TEST_F(NullDecrypterTest, DecryptClientPre37) {
@@ -63,10 +61,10 @@ TEST_F(NullDecrypterTest, DecryptClientPre37) {
char buffer[256];
size_t length = 0;
ASSERT_TRUE(decrypter.DecryptPacket(QUIC_VERSION_36, 0, "hello world!",
- StringPiece(data, len), buffer, &length,
- 256));
+ QuicStringPiece(data, len), buffer,
+ &length, 256));
EXPECT_LT(0u, length);
- EXPECT_EQ("goodbye!", StringPiece(buffer, length));
+ EXPECT_EQ("goodbye!", QuicStringPiece(buffer, length));
}
TEST_F(NullDecrypterTest, DecryptServerPre37) {
@@ -82,10 +80,10 @@ TEST_F(NullDecrypterTest, DecryptServerPre37) {
char buffer[256];
size_t length = 0;
ASSERT_TRUE(decrypter.DecryptPacket(QUIC_VERSION_36, 0, "hello world!",
- StringPiece(data, len), buffer, &length,
- 256));
+ QuicStringPiece(data, len), buffer,
+ &length, 256));
EXPECT_LT(0u, length);
- EXPECT_EQ("goodbye!", StringPiece(buffer, length));
+ EXPECT_EQ("goodbye!", QuicStringPiece(buffer, length));
}
TEST_F(NullDecrypterTest, BadHash) {
@@ -101,8 +99,8 @@ TEST_F(NullDecrypterTest, BadHash) {
char buffer[256];
size_t length = 0;
ASSERT_FALSE(decrypter.DecryptPacket(QUIC_VERSION_35, 0, "hello world!",
- StringPiece(data, len), buffer, &length,
- 256));
+ QuicStringPiece(data, len), buffer,
+ &length, 256));
}
TEST_F(NullDecrypterTest, ShortInput) {
@@ -116,8 +114,8 @@ TEST_F(NullDecrypterTest, ShortInput) {
char buffer[256];
size_t length = 0;
ASSERT_FALSE(decrypter.DecryptPacket(QUIC_VERSION_35, 0, "hello world!",
- StringPiece(data, len), buffer, &length,
- 256));
+ QuicStringPiece(data, len), buffer,
+ &length, 256));
}
} // namespace test
« no previous file with comments | « net/quic/core/crypto/null_decrypter.cc ('k') | net/quic/core/crypto/null_encrypter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698