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

Side by Side Diff: net/url_request/url_request_unittest.cc

Issue 2673753004: Fix set_up_quic_server_info_factory in HttpCache creation (Closed)
Patch Set: 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 <memory> 5 #include <memory>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
(...skipping 7719 matching lines...) Expand 10 before | Expand all | Expand 10 after
7730 // Check that creating a network request while entering/exiting suspend mode 7730 // Check that creating a network request while entering/exiting suspend mode
7731 // fails as it should. This is the only case where an HttpTransactionFactory 7731 // fails as it should. This is the only case where an HttpTransactionFactory
7732 // does not return an HttpTransaction. 7732 // does not return an HttpTransaction.
7733 TEST_F(URLRequestTestHTTP, NetworkSuspendTest) { 7733 TEST_F(URLRequestTestHTTP, NetworkSuspendTest) {
7734 // Create a new HttpNetworkLayer that thinks it's suspended. 7734 // Create a new HttpNetworkLayer that thinks it's suspended.
7735 std::unique_ptr<HttpNetworkLayer> network_layer(new HttpNetworkLayer( 7735 std::unique_ptr<HttpNetworkLayer> network_layer(new HttpNetworkLayer(
7736 default_context_.http_transaction_factory()->GetSession())); 7736 default_context_.http_transaction_factory()->GetSession()));
7737 network_layer->OnSuspend(); 7737 network_layer->OnSuspend();
7738 7738
7739 HttpCache http_cache(std::move(network_layer), 7739 HttpCache http_cache(std::move(network_layer),
7740 HttpCache::DefaultBackend::InMemory(0), true); 7740 HttpCache::DefaultBackend::InMemory(0), false);
Ryan Hamilton 2017/02/03 19:56:36 nit: can you comment this boolean literal?
Zhongyi Shi 2017/02/03 20:03:21 Done.
7741 7741
7742 TestURLRequestContext context(true); 7742 TestURLRequestContext context(true);
7743 context.set_http_transaction_factory(&http_cache); 7743 context.set_http_transaction_factory(&http_cache);
7744 context.Init(); 7744 context.Init();
7745 7745
7746 TestDelegate d; 7746 TestDelegate d;
7747 std::unique_ptr<URLRequest> req( 7747 std::unique_ptr<URLRequest> req(
7748 context.CreateRequest(GURL("http://127.0.0.1/"), DEFAULT_PRIORITY, &d)); 7748 context.CreateRequest(GURL("http://127.0.0.1/"), DEFAULT_PRIORITY, &d));
7749 req->Start(); 7749 req->Start();
7750 base::RunLoop().Run(); 7750 base::RunLoop().Run();
(...skipping 2989 matching lines...) Expand 10 before | Expand all | Expand 10 after
10740 AddTestInterceptor()->set_main_intercept_job(std::move(job)); 10740 AddTestInterceptor()->set_main_intercept_job(std::move(job));
10741 10741
10742 req->Start(); 10742 req->Start();
10743 req->Cancel(); 10743 req->Cancel();
10744 base::RunLoop().RunUntilIdle(); 10744 base::RunLoop().RunUntilIdle();
10745 EXPECT_EQ(ERR_ABORTED, d.request_status()); 10745 EXPECT_EQ(ERR_ABORTED, d.request_status());
10746 EXPECT_EQ(0, d.received_redirect_count()); 10746 EXPECT_EQ(0, d.received_redirect_count());
10747 } 10747 }
10748 10748
10749 } // namespace net 10749 } // namespace net
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_io_data.cc ('k') | net/url_request/view_cache_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698