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

Unified Diff: net/quic/quic_stream_factory_test.cc

Issue 2131813002: Revert of QUIC - Race Cert Verification with host resolution if certs are (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/quic_stream_factory.cc ('k') | net/quic/test_tools/quic_stream_factory_peer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_stream_factory_test.cc
diff --git a/net/quic/quic_stream_factory_test.cc b/net/quic/quic_stream_factory_test.cc
index 005f3863d20e0f78723739112bff6dc3e47fa973..c8da53ce761c46ee916fa88bd5dfb89cdd6bf715 100644
--- a/net/quic/quic_stream_factory_test.cc
+++ b/net/quic/quic_stream_factory_test.cc
@@ -315,16 +315,16 @@
disable_quic_on_timeout_with_open_streams_(false),
idle_connection_timeout_seconds_(kIdleConnectionTimeoutSeconds),
migrate_sessions_on_network_change_(false),
- migrate_sessions_early_(false),
- race_cert_verification_(false) {
+ migrate_sessions_early_(false) {
clock_->AdvanceTime(QuicTime::Delta::FromSeconds(1));
}
~QuicStreamFactoryTestBase() {
// If |factory_| was initialized, then it took over ownership of |clock_|.
// If |factory_| was not initialized, then |clock_| needs to be destroyed.
- if (!factory_)
+ if (!factory_) {
delete clock_;
+ }
}
void Initialize() {
@@ -347,7 +347,7 @@
close_sessions_on_ip_change_,
disable_quic_on_timeout_with_open_streams_,
idle_connection_timeout_seconds_, migrate_sessions_on_network_change_,
- migrate_sessions_early_, race_cert_verification_, QuicTagVector(),
+ migrate_sessions_early_, QuicTagVector(),
/*enable_token_binding*/ false));
factory_->set_require_confirmation(false);
EXPECT_FALSE(factory_->has_quic_server_info_factory());
@@ -371,11 +371,6 @@
bool HasActiveSession(const HostPortPair& host_port_pair) {
QuicServerId server_id(host_port_pair, PRIVACY_MODE_DISABLED);
return QuicStreamFactoryPeer::HasActiveSession(factory_.get(), server_id);
- }
-
- bool HasActiveCertVerifierJob(const QuicServerId& server_id) {
- return QuicStreamFactoryPeer::HasActiveCertVerifierJob(factory_.get(),
- server_id);
}
QuicChromiumClientSession* GetActiveSession(
@@ -545,7 +540,6 @@
int idle_connection_timeout_seconds_;
bool migrate_sessions_on_network_change_;
bool migrate_sessions_early_;
- bool race_cert_verification_;
};
class QuicStreamFactoryTest : public QuicStreamFactoryTestBase,
@@ -3876,61 +3870,6 @@
EXPECT_EQ(test_cert2, cached2->certs()[0]);
}
-TEST_P(QuicStreamFactoryTest, StartCertVerifyJob) {
- Initialize();
-
- MockRead reads[] = {MockRead(SYNCHRONOUS, ERR_IO_PENDING, 0)};
- SequencedSocketData socket_data(reads, arraysize(reads), nullptr, 0);
- socket_factory_.AddSocketDataProvider(&socket_data);
-
- // Save current state of |race_cert_verification|.
- bool race_cert_verification =
- QuicStreamFactoryPeer::GetRaceCertVerification(factory_.get());
-
- // Load server config.
- HostPortPair host_port_pair("test.example.com", kDefaultServerPort);
- QuicServerId quic_server_id(host_port_pair_, privacy_mode_);
- QuicStreamFactoryPeer::CacheDummyServerConfig(factory_.get(), quic_server_id);
-
- QuicStreamFactoryPeer::SetRaceCertVerification(factory_.get(), true);
-
- // Start CertVerifyJob.
- QuicStreamFactoryPeer::StartCertVerifyJob(factory_.get(), quic_server_id,
- /*cert_verify_flags=*/0, net_log_);
-
- // Verify CertVerifierJob has started.
- EXPECT_TRUE(HasActiveCertVerifierJob(quic_server_id));
-
- while (HasActiveCertVerifierJob(quic_server_id)) {
- base::RunLoop().RunUntilIdle();
- }
- // Verify CertVerifierJob has finished.
- EXPECT_FALSE(HasActiveCertVerifierJob(quic_server_id));
-
- // Start a QUIC request.
- QuicStreamRequest request(factory_.get());
- EXPECT_EQ(ERR_IO_PENDING,
- request.Request(host_port_pair_, privacy_mode_,
- /*cert_verify_flags=*/0, url_, "GET", net_log_,
- callback_.callback()));
-
- EXPECT_EQ(OK, callback_.WaitForResult());
-
- std::unique_ptr<QuicHttpStream> stream = request.CreateStream();
- EXPECT_TRUE(stream.get());
-
- // Restore |race_cert_verification|.
- QuicStreamFactoryPeer::SetRaceCertVerification(factory_.get(),
- race_cert_verification);
-
- EXPECT_TRUE(socket_data.AllReadDataConsumed());
- EXPECT_TRUE(socket_data.AllWriteDataConsumed());
-
- // Verify there are no outstanding CertVerifierJobs after request has
- // finished.
- EXPECT_FALSE(HasActiveCertVerifierJob(quic_server_id));
-}
-
TEST_P(QuicStreamFactoryTest, QuicDoingZeroRTT) {
Initialize();
« no previous file with comments | « net/quic/quic_stream_factory.cc ('k') | net/quic/test_tools/quic_stream_factory_peer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698