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

Unified Diff: net/quic/core/crypto/cert_compressor_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/cert_compressor.cc ('k') | net/quic/core/crypto/chacha20_poly1305_decrypter_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/crypto/cert_compressor_test.cc
diff --git a/net/quic/core/crypto/cert_compressor_test.cc b/net/quic/core/crypto/cert_compressor_test.cc
index 2ab9094c8d5806789691f78308da9e95e0892fbf..af6f6174c60d77bfdb574a757d23f692078518d2 100644
--- a/net/quic/core/crypto/cert_compressor_test.cc
+++ b/net/quic/core/crypto/cert_compressor_test.cc
@@ -11,7 +11,6 @@
#include "net/quic/test_tools/crypto_test_utils.h"
#include "testing/gtest/include/gtest/gtest.h"
-using base::StringPiece;
using std::string;
namespace net {
@@ -20,7 +19,7 @@ namespace test {
TEST(CertCompressor, EmptyChain) {
std::vector<string> chain;
const string compressed = CertCompressor::CompressChain(
- chain, StringPiece(), StringPiece(), nullptr);
+ chain, QuicStringPiece(), QuicStringPiece(), nullptr);
EXPECT_EQ("00", QuicTextUtils::HexEncode(compressed));
std::vector<string> chain2, cached_certs;
@@ -33,7 +32,7 @@ TEST(CertCompressor, Compressed) {
std::vector<string> chain;
chain.push_back("testcert");
const string compressed = CertCompressor::CompressChain(
- chain, StringPiece(), StringPiece(), nullptr);
+ chain, QuicStringPiece(), QuicStringPiece(), nullptr);
ASSERT_GE(compressed.size(), 2u);
EXPECT_EQ("0100", QuicTextUtils::HexEncode(compressed.substr(0, 2)));
@@ -52,8 +51,9 @@ TEST(CertCompressor, Common) {
crypto_test_utils::MockCommonCertSets(chain[0], set_hash, 1));
const string compressed = CertCompressor::CompressChain(
chain,
- StringPiece(reinterpret_cast<const char*>(&set_hash), sizeof(set_hash)),
- StringPiece(), common_sets.get());
+ QuicStringPiece(reinterpret_cast<const char*>(&set_hash),
+ sizeof(set_hash)),
+ QuicStringPiece(), common_sets.get());
EXPECT_EQ(
"03" /* common */
"2a00000000000000" /* set hash 42 */
@@ -72,9 +72,9 @@ TEST(CertCompressor, Cached) {
std::vector<string> chain;
chain.push_back("testcert");
uint64_t hash = QuicUtils::FNV1a_64_Hash(chain[0]);
- StringPiece hash_bytes(reinterpret_cast<char*>(&hash), sizeof(hash));
- const string compressed =
- CertCompressor::CompressChain(chain, StringPiece(), hash_bytes, nullptr);
+ QuicStringPiece hash_bytes(reinterpret_cast<char*>(&hash), sizeof(hash));
+ const string compressed = CertCompressor::CompressChain(
+ chain, QuicStringPiece(), hash_bytes, nullptr);
EXPECT_EQ("02" /* cached */ + QuicTextUtils::HexEncode(hash_bytes) +
"00" /* end of list */,
« no previous file with comments | « net/quic/core/crypto/cert_compressor.cc ('k') | net/quic/core/crypto/chacha20_poly1305_decrypter_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698