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

Unified Diff: net/http/disk_cache_based_quic_server_info_unittest.cc

Issue 2668563002: Change MockHttpCache constructor to take boolean to set quic server info factory (Closed)
Patch Set: add one more constructor to MockHttpCache Created 3 years, 11 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/http/mock_http_cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/disk_cache_based_quic_server_info_unittest.cc
diff --git a/net/http/disk_cache_based_quic_server_info_unittest.cc b/net/http/disk_cache_based_quic_server_info_unittest.cc
index d4d338eef78e6d62dfd6827fede0f1953eec557b..55f5835b8c96a5ff6a84f726f93ec74e4d1cc3fe 100644
--- a/net/http/disk_cache_based_quic_server_info_unittest.cc
+++ b/net/http/disk_cache_based_quic_server_info_unittest.cc
@@ -94,7 +94,7 @@ TEST(DiskCacheBasedQuicServerInfo, DeleteInCallback) {
// Use the blocking mock backend factory to force asynchronous completion
// of quic_server_info->WaitForDataReady(), so that the callback will run.
MockBlockingBackendFactory* factory = new MockBlockingBackendFactory();
- MockHttpCache cache(base::WrapUnique(factory));
+ MockHttpCache cache(base::WrapUnique(factory), true);
QuicServerId server_id("www.verisign.com", 443, PRIVACY_MODE_DISABLED);
std::unique_ptr<QuicServerInfo> quic_server_info(
new DiskCacheBasedQuicServerInfo(server_id, cache.http_cache()));
@@ -109,7 +109,7 @@ TEST(DiskCacheBasedQuicServerInfo, DeleteInCallback) {
// Tests the basic logic of storing, retrieving and updating data.
TEST(DiskCacheBasedQuicServerInfo, Update) {
- MockHttpCache cache;
+ MockHttpCache cache(true);
AddMockTransaction(&kHostInfoTransaction1);
TestCompletionCallback callback;
@@ -180,7 +180,7 @@ TEST(DiskCacheBasedQuicServerInfo, Update) {
// Test that demonstrates different info is returned when the ports differ.
TEST(DiskCacheBasedQuicServerInfo, UpdateDifferentPorts) {
- MockHttpCache cache;
+ MockHttpCache cache(true);
AddMockTransaction(&kHostInfoTransaction1);
AddMockTransaction(&kHostInfoTransaction2);
TestCompletionCallback callback;
@@ -281,7 +281,7 @@ TEST(DiskCacheBasedQuicServerInfo, UpdateDifferentPorts) {
// Test IsReadyToPersist when there is a pending write.
TEST(DiskCacheBasedQuicServerInfo, IsReadyToPersist) {
- MockHttpCache cache;
+ MockHttpCache cache(true);
AddMockTransaction(&kHostInfoTransaction1);
TestCompletionCallback callback;
@@ -343,7 +343,7 @@ TEST(DiskCacheBasedQuicServerInfo, IsReadyToPersist) {
// Test multiple calls to Persist.
TEST(DiskCacheBasedQuicServerInfo, MultiplePersist) {
- MockHttpCache cache;
+ MockHttpCache cache(true);
AddMockTransaction(&kHostInfoTransaction1);
TestCompletionCallback callback;
@@ -433,7 +433,7 @@ TEST(DiskCacheBasedQuicServerInfo, MultiplePersist) {
TEST(DiskCacheBasedQuicServerInfo, CancelWaitForDataReady) {
MockBlockingBackendFactory* factory = new MockBlockingBackendFactory();
- MockHttpCache cache(base::WrapUnique(factory));
+ MockHttpCache cache(base::WrapUnique(factory), true);
TestCompletionCallback callback;
QuicServerId server_id("www.google.com", 443, PRIVACY_MODE_DISABLED);
std::unique_ptr<QuicServerInfo> quic_server_info(
@@ -451,7 +451,7 @@ TEST(DiskCacheBasedQuicServerInfo, CancelWaitForDataReady) {
}
TEST(DiskCacheBasedQuicServerInfo, CancelWaitForDataReadyButDataIsReady) {
- MockHttpCache cache;
+ MockHttpCache cache(true);
AddMockTransaction(&kHostInfoTransaction1);
TestCompletionCallback callback;
@@ -470,7 +470,7 @@ TEST(DiskCacheBasedQuicServerInfo, CancelWaitForDataReadyButDataIsReady) {
TEST(DiskCacheBasedQuicServerInfo, CancelWaitForDataReadyAfterDeleteCache) {
std::unique_ptr<QuicServerInfo> quic_server_info;
{
- MockHttpCache cache;
+ MockHttpCache cache(true);
AddMockTransaction(&kHostInfoTransaction1);
TestCompletionCallback callback;
@@ -491,7 +491,7 @@ TEST(DiskCacheBasedQuicServerInfo, CancelWaitForDataReadyAfterDeleteCache) {
// Test Start() followed by Persist() without calling WaitForDataReady.
TEST(DiskCacheBasedQuicServerInfo, StartAndPersist) {
- MockHttpCache cache;
+ MockHttpCache cache(true);
AddMockTransaction(&kHostInfoTransaction1);
QuicServerId server_id("www.google.com", 443, PRIVACY_MODE_DISABLED);
@@ -557,7 +557,7 @@ TEST(DiskCacheBasedQuicServerInfo, StartAndPersist) {
// persists the data when Start() finishes.
TEST(DiskCacheBasedQuicServerInfo, PersistWhenNotReadyToPersist) {
MockBlockingBackendFactory* factory = new MockBlockingBackendFactory();
- MockHttpCache cache(base::WrapUnique(factory));
+ MockHttpCache cache(base::WrapUnique(factory), true);
AddMockTransaction(&kHostInfoTransaction1);
TestCompletionCallback callback;
@@ -618,7 +618,7 @@ TEST(DiskCacheBasedQuicServerInfo, PersistWhenNotReadyToPersist) {
// Test multiple calls to Persist without waiting for the data to be written.
TEST(DiskCacheBasedQuicServerInfo, MultiplePersistsWithoutWaiting) {
- MockHttpCache cache;
+ MockHttpCache cache(true);
AddMockTransaction(&kHostInfoTransaction1);
TestCompletionCallback callback;
@@ -704,7 +704,7 @@ TEST(DiskCacheBasedQuicServerInfo, DeleteServerInfoInCallback) {
// Use the blocking mock backend factory to force asynchronous completion
// of quic_server_info->WaitForDataReady(), so that the callback will run.
MockBlockingBackendFactory* factory = new MockBlockingBackendFactory();
- MockHttpCache cache(base::WrapUnique(factory));
+ MockHttpCache cache(base::WrapUnique(factory), true);
QuicServerId server_id("www.verisign.com", 443, PRIVACY_MODE_DISABLED);
QuicServerInfo* quic_server_info =
new DiskCacheBasedQuicServerInfo(server_id, cache.http_cache());
« no previous file with comments | « no previous file | net/http/mock_http_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698