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

Unified Diff: net/url_request/url_request_quic_unittest.cc

Issue 2518063007: Pass QuicInMemoryCache directly instead of using a singleton. (Closed)
Patch Set: Fix Cronet compile error Created 4 years, 1 month 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/tools/quic/test_tools/quic_test_server.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/url_request_quic_unittest.cc
diff --git a/net/url_request/url_request_quic_unittest.cc b/net/url_request/url_request_quic_unittest.cc
index e37baffe69acd672c09dd013a5316f05460c1549..9788128a4987102489b5b0d33baa54d4110c856f 100644
--- a/net/url_request/url_request_quic_unittest.cc
+++ b/net/url_request/url_request_quic_unittest.cc
@@ -22,7 +22,6 @@
#include "net/test/test_data_directory.h"
#include "net/tools/quic/quic_in_memory_cache.h"
#include "net/tools/quic/quic_simple_server.h"
-#include "net/tools/quic/test_tools/quic_in_memory_cache_peer.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_test_util.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -93,9 +92,8 @@ class URLRequestQuicTest : public ::testing::Test {
private:
void StartQuicServer() {
// Set up in-memory cache.
- test::QuicInMemoryCachePeer::ResetForTests();
- QuicInMemoryCache::GetInstance()->AddSimpleResponse(
- kTestServerHost, kHelloPath, kHelloStatus, kHelloBodyValue);
+ in_memory_cache_.AddSimpleResponse(kTestServerHost, kHelloPath,
+ kHelloStatus, kHelloBodyValue);
net::QuicConfig config;
// Set up server certs.
std::unique_ptr<net::ProofSourceChromium> proof_source(
@@ -107,7 +105,8 @@ class URLRequestQuicTest : public ::testing::Test {
directory.Append(FILE_PATH_LITERAL("quic_test.example.com.key.sct"))));
server_.reset(new QuicSimpleServer(
test::CryptoTestUtils::ProofSourceForTesting(), config,
- net::QuicCryptoServerConfig::ConfigOptions(), AllSupportedVersions()));
+ net::QuicCryptoServerConfig::ConfigOptions(), AllSupportedVersions(),
+ &in_memory_cache_));
int rv = server_->Listen(
net::IPEndPoint(net::IPAddress::IPv4AllZeros(), kTestServerPort));
EXPECT_GE(rv, 0) << "Quic server fails to start";
@@ -125,6 +124,7 @@ class URLRequestQuicTest : public ::testing::Test {
std::unique_ptr<MappedHostResolver> host_resolver_;
std::unique_ptr<QuicSimpleServer> server_;
std::unique_ptr<TestURLRequestContext> context_;
+ QuicInMemoryCache in_memory_cache_;
MockCertVerifier cert_verifier_;
};
« no previous file with comments | « net/tools/quic/test_tools/quic_test_server.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698