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

Side by Side Diff: content/browser/loader/test_url_loader_client.cc

Issue 2817033002: Plumb the net::SSLInfo to the browser process when it's using the network service. (Closed)
Patch Set: add net::SSLInfo test 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "content/browser/loader/test_url_loader_client.h" 5 #include "content/browser/loader/test_url_loader_client.h"
6 6
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 TestURLLoaderClient::TestURLLoaderClient() : binding_(this) {} 13 TestURLLoaderClient::TestURLLoaderClient() : binding_(this) {}
14 TestURLLoaderClient::~TestURLLoaderClient() {} 14 TestURLLoaderClient::~TestURLLoaderClient() {}
15 15
16 void TestURLLoaderClient::OnReceiveResponse( 16 void TestURLLoaderClient::OnReceiveResponse(
17 const ResourceResponseHead& response_head, 17 const ResourceResponseHead& response_head,
18 const base::Optional<net::SSLInfo>& ssl_info,
18 mojom::DownloadedTempFilePtr downloaded_file) { 19 mojom::DownloadedTempFilePtr downloaded_file) {
19 EXPECT_FALSE(has_received_response_); 20 EXPECT_FALSE(has_received_response_);
20 EXPECT_FALSE(has_received_cached_metadata_); 21 EXPECT_FALSE(has_received_cached_metadata_);
21 EXPECT_FALSE(has_received_completion_); 22 EXPECT_FALSE(has_received_completion_);
22 has_received_response_ = true; 23 has_received_response_ = true;
23 response_head_ = response_head; 24 response_head_ = response_head;
25 ssl_info_ = ssl_info;
24 if (quit_closure_for_on_receive_response_) 26 if (quit_closure_for_on_receive_response_)
25 quit_closure_for_on_receive_response_.Run(); 27 quit_closure_for_on_receive_response_.Run();
26 } 28 }
27 29
28 void TestURLLoaderClient::OnReceiveRedirect( 30 void TestURLLoaderClient::OnReceiveRedirect(
29 const net::RedirectInfo& redirect_info, 31 const net::RedirectInfo& redirect_info,
30 const ResourceResponseHead& response_head) { 32 const ResourceResponseHead& response_head) {
31 EXPECT_FALSE(has_received_cached_metadata_); 33 EXPECT_FALSE(has_received_cached_metadata_);
32 EXPECT_FALSE(response_body_.is_valid()); 34 EXPECT_FALSE(response_body_.is_valid());
33 EXPECT_FALSE(has_received_response_); 35 EXPECT_FALSE(has_received_response_);
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 void TestURLLoaderClient::RunUntilComplete() { 169 void TestURLLoaderClient::RunUntilComplete() {
168 if (has_received_completion_) 170 if (has_received_completion_)
169 return; 171 return;
170 base::RunLoop run_loop; 172 base::RunLoop run_loop;
171 quit_closure_for_on_complete_ = run_loop.QuitClosure(); 173 quit_closure_for_on_complete_ = run_loop.QuitClosure();
172 run_loop.Run(); 174 run_loop.Run();
173 quit_closure_for_on_complete_.Reset(); 175 quit_closure_for_on_complete_.Reset();
174 } 176 }
175 177
176 } // namespace content 178 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/test_url_loader_client.h ('k') | content/browser/loader/url_loader_factory_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698