Chromium Code Reviews| Index: net/http/http_cache_lookup_manager_unittest.cc |
| diff --git a/net/http/http_cache_lookup_manager_unittest.cc b/net/http/http_cache_lookup_manager_unittest.cc |
| index 439aee74a386990afbb66aaf9ff04186392bebb2..ffb11158f2038514c53adfe89659e5cb39efb0e1 100644 |
| --- a/net/http/http_cache_lookup_manager_unittest.cc |
| +++ b/net/http/http_cache_lookup_manager_unittest.cc |
| @@ -84,8 +84,8 @@ void PopulateCacheEntry(HttpCache* cache, const GURL& request_url) { |
| TEST(HttpCacheLookupManagerTest, ServerPushMissCache) { |
| MockHttpCache mock_cache; |
| - HttpCacheLookupManager push_delegate(mock_cache.http_cache(), |
| - NetLogWithSource()); |
| + NetLog net_log; |
| + HttpCacheLookupManager push_delegate(mock_cache.http_cache(), &net_log); |
| GURL request_url("http://www.example.com/pushed.jpg"); |
| std::unique_ptr<MockServerPushHelper> push_helper = |
| @@ -94,7 +94,7 @@ TEST(HttpCacheLookupManagerTest, ServerPushMissCache) { |
| // Receive a server push and should not cancel the push. |
| EXPECT_CALL(*push_helper_ptr, Cancel()).Times(0); |
| - push_delegate.OnPush(std::move(push_helper)); |
| + push_delegate.OnPush(std::move(push_helper), NetLogWithSource()); |
| base::RunLoop().RunUntilIdle(); |
| // Make sure no network transaction is created. |
| @@ -105,8 +105,8 @@ TEST(HttpCacheLookupManagerTest, ServerPushMissCache) { |
| TEST(HttpCacheLookupManagerTest, ServerPushDoNotCreateCacheEntry) { |
| MockHttpCache mock_cache; |
| - HttpCacheLookupManager push_delegate(mock_cache.http_cache(), |
| - NetLogWithSource()); |
| + NetLog net_log; |
| + HttpCacheLookupManager push_delegate(mock_cache.http_cache(), &net_log); |
| GURL request_url("http://www.example.com/pushed.jpg"); |
| std::unique_ptr<MockServerPushHelper> push_helper = |
| @@ -115,7 +115,7 @@ TEST(HttpCacheLookupManagerTest, ServerPushDoNotCreateCacheEntry) { |
| // Receive a server push and should not cancel the push. |
| EXPECT_CALL(*push_helper_ptr, Cancel()).Times(0); |
| - push_delegate.OnPush(std::move(push_helper)); |
| + push_delegate.OnPush(std::move(push_helper), NetLogWithSource()); |
| base::RunLoop().RunUntilIdle(); |
| // Receive another server push for the same url. |
| @@ -123,7 +123,7 @@ TEST(HttpCacheLookupManagerTest, ServerPushDoNotCreateCacheEntry) { |
| base::MakeUnique<MockServerPushHelper>(request_url); |
| MockServerPushHelper* push_helper_ptr2 = push_helper2.get(); |
| EXPECT_CALL(*push_helper_ptr2, Cancel()).Times(0); |
| - push_delegate.OnPush(std::move(push_helper2)); |
| + push_delegate.OnPush(std::move(push_helper2), NetLogWithSource()); |
| base::RunLoop().RunUntilIdle(); |
| // Verify no network transaction is created. |
| @@ -135,8 +135,8 @@ TEST(HttpCacheLookupManagerTest, ServerPushDoNotCreateCacheEntry) { |
| TEST(HttpCacheLookupManagerTest, ServerPushHitCache) { |
| MockHttpCache mock_cache; |
| - HttpCacheLookupManager push_delegate(mock_cache.http_cache(), |
| - NetLogWithSource()); |
| + NetLog net_log; |
| + HttpCacheLookupManager push_delegate(mock_cache.http_cache(), &net_log); |
| GURL request_url("http://www.example.com/pushed.jpg"); |
| // Populate the cache entry so that the cache lookup for server push hits. |
| @@ -157,7 +157,7 @@ TEST(HttpCacheLookupManagerTest, ServerPushHitCache) { |
| // Receive a server push and should cancel the push. |
| EXPECT_CALL(*push_helper_ptr, Cancel()).Times(1); |
| - push_delegate.OnPush(std::move(push_helper)); |
| + push_delegate.OnPush(std::move(push_helper), NetLogWithSource()); |
| base::RunLoop().RunUntilIdle(); |
| // Make sure no new net layer transaction is created. |
| @@ -173,8 +173,8 @@ TEST(HttpCacheLookupManagerTest, ServerPushHitCache) { |
| // send a new lookup transaction and should not be canceled. |
| TEST(HttpCacheLookupManagerTest, ServerPushPendingLookup) { |
| MockHttpCache mock_cache; |
| - HttpCacheLookupManager push_delegate(mock_cache.http_cache(), |
| - NetLogWithSource()); |
| + NetLog net_log; |
| + HttpCacheLookupManager push_delegate(mock_cache.http_cache(), &net_log); |
| GURL request_url("http://www.example.com/pushed.jpg"); |
| // Populate the cache entry so that the cache lookup for server push hits. |
| @@ -195,7 +195,7 @@ TEST(HttpCacheLookupManagerTest, ServerPushPendingLookup) { |
| // Receive a server push and should cancel the push eventually. |
| EXPECT_CALL(*push_helper_ptr, Cancel()).Times(1); |
| - push_delegate.OnPush(std::move(push_helper)); |
| + push_delegate.OnPush(std::move(push_helper), NetLogWithSource()); |
| std::unique_ptr<MockServerPushHelper> push_helper2 = |
| base::MakeUnique<MockServerPushHelper>(request_url); |
| @@ -203,7 +203,7 @@ TEST(HttpCacheLookupManagerTest, ServerPushPendingLookup) { |
| // Receive another server push and should not cancel the push. |
| EXPECT_CALL(*push_helper_ptr2, Cancel()).Times(0); |
| - push_delegate.OnPush(std::move(push_helper2)); |
| + push_delegate.OnPush(std::move(push_helper2), NetLogWithSource()); |
| base::RunLoop().RunUntilIdle(); |
| @@ -218,8 +218,8 @@ TEST(HttpCacheLookupManagerTest, ServerPushPendingLookup) { |
| // Test the server push lookup is based on the full url. |
| TEST(HttpCacheLookupManagerTest, ServerPushLookupOnUrl) { |
| MockHttpCache mock_cache; |
| - HttpCacheLookupManager push_delegate(mock_cache.http_cache(), |
| - NetLogWithSource()); |
| + NetLog net_log; |
|
eroman
2017/02/07 22:33:42
If you change some of these to use TestNetLog, the
Zhongyi Shi
2017/02/08 00:40:53
Will do in a follow-up CL since I realized that th
|
| + HttpCacheLookupManager push_delegate(mock_cache.http_cache(), &net_log); |
| GURL request_url("http://www.example.com/pushed.jpg?u=0"); |
| GURL request_url2("http://www.example.com/pushed.jpg?u=1"); |
| @@ -241,7 +241,7 @@ TEST(HttpCacheLookupManagerTest, ServerPushLookupOnUrl) { |
| // Receive a server push and should cancel the push eventually. |
| EXPECT_CALL(*push_helper_ptr, Cancel()).Times(1); |
| - push_delegate.OnPush(std::move(push_helper)); |
| + push_delegate.OnPush(std::move(push_helper), NetLogWithSource()); |
| // Run until the lookup transaction finishes for the first server push. |
| base::RunLoop().RunUntilIdle(); |
| EXPECT_EQ(1, mock_cache.network_layer()->transaction_count()); |
| @@ -257,7 +257,7 @@ TEST(HttpCacheLookupManagerTest, ServerPushLookupOnUrl) { |
| MockServerPushHelper* push_helper_ptr2 = push_helper2.get(); |
| EXPECT_CALL(*push_helper_ptr2, Cancel()).Times(1); |
| - push_delegate.OnPush(std::move(push_helper2)); |
| + push_delegate.OnPush(std::move(push_helper2), NetLogWithSource()); |
| // Run until the lookup transaction finishes for the second server push. |
| base::RunLoop().RunUntilIdle(); |
| EXPECT_EQ(1, mock_cache.network_layer()->transaction_count()); |
| @@ -275,7 +275,7 @@ TEST(HttpCacheLookupManagerTest, ServerPushLookupOnUrl) { |
| MockServerPushHelper* push_helper_ptr3 = push_helper3.get(); |
| EXPECT_CALL(*push_helper_ptr3, Cancel()).Times(0); |
| - push_delegate.OnPush(std::move(push_helper3)); |
| + push_delegate.OnPush(std::move(push_helper3), NetLogWithSource()); |
| base::RunLoop().RunUntilIdle(); |
| // Make sure no new net layer transaction is created. |