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

Unified Diff: net/quic/core/crypto/crypto_server_test.cc

Issue 2338013004: Simplify lifetime management of ValidateClientHelloResultCallback::Result objects (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | net/quic/core/crypto/quic_crypto_server_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/core/crypto/crypto_server_test.cc
diff --git a/net/quic/core/crypto/crypto_server_test.cc b/net/quic/core/crypto/crypto_server_test.cc
index 974f319416187c4d77f58c2334141f57e893b0b8..564d05a11697c0d0f06fd5210145c66187b34726 100644
--- a/net/quic/core/crypto/crypto_server_test.cc
+++ b/net/quic/core/crypto/crypto_server_test.cc
@@ -201,8 +201,7 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
*called_ = false;
}
- void RunImpl(const CryptoHandshakeMessage& client_hello,
- const Result& result,
+ void RunImpl(std::unique_ptr<Result> result,
std::unique_ptr<ProofSource::Details> /* details */) override {
{
// Ensure that the strike register client lock is not held.
@@ -214,8 +213,7 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
base::AutoLock lock(*m);
}
ASSERT_FALSE(*called_);
- test_->ProcessValidationResult(client_hello, result, should_succeed_,
- error_substr_);
+ test_->ProcessValidationResult(*result, should_succeed_, error_substr_);
*called_ = true;
}
@@ -270,8 +268,7 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
new ValidateCallback(this, false, error_substr, called));
}
- void ProcessValidationResult(const CryptoHandshakeMessage& message,
- const ValidateCallback::Result& result,
+ void ProcessValidationResult(const ValidateCallback::Result& result,
bool should_succeed,
const char* error_substr) {
IPAddress server_ip;
@@ -290,10 +287,10 @@ class CryptoServerTest : public ::testing::TestWithParam<TestParams> {
if (should_succeed) {
ASSERT_EQ(error, QUIC_NO_ERROR) << "Message failed with error "
<< error_details << ": "
- << message.DebugString();
+ << result.client_hello.DebugString();
} else {
ASSERT_NE(error, QUIC_NO_ERROR) << "Message didn't fail: "
- << message.DebugString();
+ << result.client_hello.DebugString();
EXPECT_TRUE(error_details.find(error_substr) != string::npos)
<< error_substr << " not in " << error_details;
« no previous file with comments | « no previous file | net/quic/core/crypto/quic_crypto_server_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698