OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/resource_loader.h" | 5 #include "content/browser/loader/resource_loader.h" |
6 | 6 |
7 #include "base/files/file.h" | 7 #include "base/files/file.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 224 |
225 // Test browser client that captures calls to SelectClientCertificates and | 225 // Test browser client that captures calls to SelectClientCertificates and |
226 // records the arguments of the most recent call for later inspection. | 226 // records the arguments of the most recent call for later inspection. |
227 class SelectCertificateBrowserClient : public TestContentBrowserClient { | 227 class SelectCertificateBrowserClient : public TestContentBrowserClient { |
228 public: | 228 public: |
229 SelectCertificateBrowserClient() : call_count_(0) {} | 229 SelectCertificateBrowserClient() : call_count_(0) {} |
230 | 230 |
231 void SelectClientCertificate( | 231 void SelectClientCertificate( |
232 int render_process_id, | 232 int render_process_id, |
233 int render_view_id, | 233 int render_view_id, |
234 const net::HttpNetworkSession* network_session, | |
235 net::SSLCertRequestInfo* cert_request_info, | 234 net::SSLCertRequestInfo* cert_request_info, |
236 const base::Callback<void(net::X509Certificate*)>& callback) override { | 235 const base::Callback<void(net::X509Certificate*)>& callback) override { |
237 ++call_count_; | 236 ++call_count_; |
238 passed_certs_ = cert_request_info->client_certs; | 237 passed_certs_ = cert_request_info->client_certs; |
239 } | 238 } |
240 | 239 |
241 int call_count() { | 240 int call_count() { |
242 return call_count_; | 241 return call_count_; |
243 } | 242 } |
244 | 243 |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
722 ASSERT_TRUE(base::ReadFileToString(temp_path(), &contents)); | 721 ASSERT_TRUE(base::ReadFileToString(temp_path(), &contents)); |
723 EXPECT_EQ(test_data(), contents); | 722 EXPECT_EQ(test_data(), contents); |
724 | 723 |
725 // Release the loader. The file should be gone now. | 724 // Release the loader. The file should be gone now. |
726 ReleaseLoader(); | 725 ReleaseLoader(); |
727 base::RunLoop().RunUntilIdle(); | 726 base::RunLoop().RunUntilIdle(); |
728 EXPECT_FALSE(base::PathExists(temp_path())); | 727 EXPECT_FALSE(base::PathExists(temp_path())); |
729 } | 728 } |
730 | 729 |
731 } // namespace content | 730 } // namespace content |
OLD | NEW |