| 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/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "content/browser/browser_thread_impl.h" | 8 #include "content/browser/browser_thread_impl.h" |
| 9 #include "content/browser/loader/resource_loader_delegate.h" | 9 #include "content/browser/loader/resource_loader_delegate.h" |
| 10 #include "content/public/browser/resource_request_info.h" | 10 #include "content/public/browser/resource_request_info.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 private: | 143 private: |
| 144 net::CertificateList passed_certs_; | 144 net::CertificateList passed_certs_; |
| 145 int call_count_; | 145 int call_count_; |
| 146 }; | 146 }; |
| 147 | 147 |
| 148 class ResourceContextStub : public MockResourceContext { | 148 class ResourceContextStub : public MockResourceContext { |
| 149 public: | 149 public: |
| 150 explicit ResourceContextStub(net::URLRequestContext* test_request_context) | 150 explicit ResourceContextStub(net::URLRequestContext* test_request_context) |
| 151 : MockResourceContext(test_request_context) {} | 151 : MockResourceContext(test_request_context) {} |
| 152 | 152 |
| 153 virtual scoped_ptr<net::ClientCertStore> CreateClientCertStore() OVERRIDE { | 153 virtual scoped_ptr<net::ClientCertStore> CreateClientCertStore( |
| 154 const std::string& host_and_port) OVERRIDE { |
| 154 return dummy_cert_store_.Pass(); | 155 return dummy_cert_store_.Pass(); |
| 155 } | 156 } |
| 156 | 157 |
| 157 void SetClientCertStore(scoped_ptr<net::ClientCertStore> store) { | 158 void SetClientCertStore(scoped_ptr<net::ClientCertStore> store) { |
| 158 dummy_cert_store_ = store.Pass(); | 159 dummy_cert_store_ = store.Pass(); |
| 159 } | 160 } |
| 160 | 161 |
| 161 private: | 162 private: |
| 162 scoped_ptr<net::ClientCertStore> dummy_cert_store_; | 163 scoped_ptr<net::ClientCertStore> dummy_cert_store_; |
| 163 }; | 164 }; |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 // Restore the original content browser client. | 315 // Restore the original content browser client. |
| 315 SetBrowserClientForTesting(old_client); | 316 SetBrowserClientForTesting(old_client); |
| 316 | 317 |
| 317 // Check if the SelectClientCertificate was called on the content browser | 318 // Check if the SelectClientCertificate was called on the content browser |
| 318 // client. | 319 // client. |
| 319 EXPECT_EQ(1, test_client.call_count()); | 320 EXPECT_EQ(1, test_client.call_count()); |
| 320 EXPECT_EQ(net::CertificateList(), test_client.passed_certs()); | 321 EXPECT_EQ(net::CertificateList(), test_client.passed_certs()); |
| 321 } | 322 } |
| 322 | 323 |
| 323 } // namespace content | 324 } // namespace content |
| OLD | NEW |