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

Side by Side Diff: net/quic/chromium/quic_stream_factory_test.cc

Issue 2602243002: Use TaskScheduler instead of WorkerPool in multi_threaded_cert_verifier.cc. (Closed)
Patch Set: self-review Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/chromium/quic_stream_factory.h" 5 #include "net/quic/chromium/quic_stream_factory.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <ostream> 8 #include <ostream>
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
14 #include "base/message_loop/message_loop.h"
14 #include "base/run_loop.h" 15 #include "base/run_loop.h"
15 #include "base/strings/string_util.h" 16 #include "base/strings/string_util.h"
17 #include "base/test/scoped_task_scheduler.h"
16 #include "net/base/test_proxy_delegate.h" 18 #include "net/base/test_proxy_delegate.h"
17 #include "net/cert/cert_verifier.h" 19 #include "net/cert/cert_verifier.h"
18 #include "net/cert/ct_policy_enforcer.h" 20 #include "net/cert/ct_policy_enforcer.h"
19 #include "net/cert/multi_log_ct_verifier.h" 21 #include "net/cert/multi_log_ct_verifier.h"
20 #include "net/dns/mock_host_resolver.h" 22 #include "net/dns/mock_host_resolver.h"
21 #include "net/http/http_response_headers.h" 23 #include "net/http/http_response_headers.h"
22 #include "net/http/http_response_info.h" 24 #include "net/http/http_response_info.h"
23 #include "net/http/http_server_properties_impl.h" 25 #include "net/http/http_server_properties_impl.h"
24 #include "net/http/http_util.h" 26 #include "net/http/http_util.h"
25 #include "net/http/transport_security_state.h" 27 #include "net/http/transport_security_state.h"
(...skipping 4938 matching lines...) Expand 10 before | Expand all | Expand 10 after
4964 } 4966 }
4965 4967
4966 // Verifies that the alternative proxy server provided by the proxy delegate 4968 // Verifies that the alternative proxy server provided by the proxy delegate
4967 // is added to the list of supported QUIC proxy servers, and the QUIC stream 4969 // is added to the list of supported QUIC proxy servers, and the QUIC stream
4968 // factory is initialized correctly. 4970 // factory is initialized correctly.
4969 TEST_P(QuicStreamFactoryTest, MaybeInitializeAlternativeProxyServer) { 4971 TEST_P(QuicStreamFactoryTest, MaybeInitializeAlternativeProxyServer) {
4970 VerifyInitialization(true); 4972 VerifyInitialization(true);
4971 } 4973 }
4972 4974
4973 TEST_P(QuicStreamFactoryTest, StartCertVerifyJob) { 4975 TEST_P(QuicStreamFactoryTest, StartCertVerifyJob) {
4976 base::test::ScopedTaskScheduler scoped_task_scheduler(
eroman 2017/02/07 22:45:45 What is the recipe for including ScopedTaskSchedul
gab 2017/02/08 16:01:42 We could (although we'd need a way to ask for a Sc
4977 base::MessageLoop::current());
4978
4974 Initialize(); 4979 Initialize();
4975 4980
4976 MockQuicData socket_data; 4981 MockQuicData socket_data;
4977 socket_data.AddRead(SYNCHRONOUS, ERR_IO_PENDING); 4982 socket_data.AddRead(SYNCHRONOUS, ERR_IO_PENDING);
4978 socket_data.AddWrite( 4983 socket_data.AddWrite(
4979 ConstructSettingsPacket(1, SETTINGS_MAX_HEADER_LIST_SIZE, 4984 ConstructSettingsPacket(1, SETTINGS_MAX_HEADER_LIST_SIZE,
4980 kDefaultMaxUncompressedHeaderSize, nullptr)); 4985 kDefaultMaxUncompressedHeaderSize, nullptr));
4981 socket_data.AddSocketDataToFactory(&socket_factory_); 4986 socket_data.AddSocketDataToFactory(&socket_factory_);
4982 4987
4983 // Save current state of |race_cert_verification|. 4988 // Save current state of |race_cert_verification|.
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
5685 // Clear all cached states. 5690 // Clear all cached states.
5686 factory_->ClearCachedStatesInCryptoConfig( 5691 factory_->ClearCachedStatesInCryptoConfig(
5687 base::Callback<bool(const GURL&)>()); 5692 base::Callback<bool(const GURL&)>());
5688 EXPECT_TRUE(test_cases[0].state->certs().empty()); 5693 EXPECT_TRUE(test_cases[0].state->certs().empty());
5689 EXPECT_TRUE(test_cases[1].state->certs().empty()); 5694 EXPECT_TRUE(test_cases[1].state->certs().empty());
5690 EXPECT_TRUE(test_cases[2].state->certs().empty()); 5695 EXPECT_TRUE(test_cases[2].state->certs().empty());
5691 } 5696 }
5692 5697
5693 } // namespace test 5698 } // namespace test
5694 } // namespace net 5699 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698