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

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

Issue 2721933002: HttpCache::Transaction layer allowing parallel validation (Closed)
Patch Set: Rebased + test-only changes for fixing the new Push Cache Lookup failing unit tests Created 3 years, 8 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 4120 matching lines...) Expand 10 before | Expand all | Expand 10 after
4131 context.Init(); 4131 context.Init();
4132 4132
4133 d.set_credentials(AuthCredentials(kUser, kSecret)); 4133 d.set_credentials(AuthCredentials(kUser, kSecret));
4134 4134
4135 { 4135 {
4136 GURL url(http_test_server()->GetURL("/auth-basic")); 4136 GURL url(http_test_server()->GetURL("/auth-basic"));
4137 std::unique_ptr<URLRequest> r( 4137 std::unique_ptr<URLRequest> r(
4138 context.CreateRequest(url, DEFAULT_PRIORITY, &d)); 4138 context.CreateRequest(url, DEFAULT_PRIORITY, &d));
4139 r->Start(); 4139 r->Start();
4140 4140
4141 base::RunLoop().Run();
4142
4141 { 4143 {
4142 HttpRequestHeaders headers; 4144 HttpRequestHeaders headers;
4143 EXPECT_TRUE(r->GetFullRequestHeaders(&headers)); 4145 EXPECT_TRUE(r->GetFullRequestHeaders(&headers));
4144 EXPECT_FALSE(headers.HasHeader("Authorization")); 4146 EXPECT_TRUE(headers.HasHeader("Authorization"));
4145 } 4147 }
4146 4148
4147 base::RunLoop().Run();
4148
4149 EXPECT_EQ(OK, d.request_status()); 4149 EXPECT_EQ(OK, d.request_status());
4150 EXPECT_EQ(200, r->GetResponseCode()); 4150 EXPECT_EQ(200, r->GetResponseCode());
4151 EXPECT_TRUE(d.auth_required_called()); 4151 EXPECT_TRUE(d.auth_required_called());
4152 EXPECT_EQ(1, network_delegate.created_requests()); 4152 EXPECT_EQ(1, network_delegate.created_requests());
4153 EXPECT_EQ(0, network_delegate.destroyed_requests()); 4153 EXPECT_EQ(0, network_delegate.destroyed_requests());
4154 } 4154 }
4155 EXPECT_EQ(1, network_delegate.destroyed_requests()); 4155 EXPECT_EQ(1, network_delegate.destroyed_requests());
4156 } 4156 }
4157 4157
4158 // Tests that the network delegate can synchronously complete OnAuthRequired 4158 // Tests that the network delegate can synchronously complete OnAuthRequired
(...skipping 6890 matching lines...) Expand 10 before | Expand all | Expand 10 after
11049 AddTestInterceptor()->set_main_intercept_job(std::move(job)); 11049 AddTestInterceptor()->set_main_intercept_job(std::move(job));
11050 11050
11051 req->Start(); 11051 req->Start();
11052 req->Cancel(); 11052 req->Cancel();
11053 base::RunLoop().RunUntilIdle(); 11053 base::RunLoop().RunUntilIdle();
11054 EXPECT_EQ(ERR_ABORTED, d.request_status()); 11054 EXPECT_EQ(ERR_ABORTED, d.request_status());
11055 EXPECT_EQ(0, d.received_redirect_count()); 11055 EXPECT_EQ(0, d.received_redirect_count());
11056 } 11056 }
11057 11057
11058 } // namespace net 11058 } // namespace net
OLDNEW
« net/http/mock_http_cache.cc ('K') | « net/url_request/url_request_quic_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698