| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 private: | 59 private: |
| 60 const net::CertificateList response_; | 60 const net::CertificateList response_; |
| 61 int request_count_; | 61 int request_count_; |
| 62 std::vector<std::string> requested_authorities_; | 62 std::vector<std::string> requested_authorities_; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 // Dummy implementation of ResourceHandler, instance of which is needed to | 65 // Dummy implementation of ResourceHandler, instance of which is needed to |
| 66 // initialize ResourceLoader. | 66 // initialize ResourceLoader. |
| 67 class ResourceHandlerStub : public ResourceHandler { | 67 class ResourceHandlerStub : public ResourceHandler { |
| 68 public: | 68 public: |
| 69 ResourceHandlerStub() : ResourceHandler(NULL) {} | |
| 70 | |
| 71 virtual bool OnUploadProgress(int request_id, | 69 virtual bool OnUploadProgress(int request_id, |
| 72 uint64 position, | 70 uint64 position, |
| 73 uint64 size) OVERRIDE { | 71 uint64 size) OVERRIDE { |
| 74 return true; | 72 return true; |
| 75 } | 73 } |
| 76 | 74 |
| 77 virtual bool OnRequestRedirected(int request_id, | 75 virtual bool OnRequestRedirected(int request_id, |
| 78 const GURL& url, | 76 const GURL& url, |
| 79 ResourceResponse* response, | 77 ResourceResponse* response, |
| 80 bool* defer) OVERRIDE { | 78 bool* defer) OVERRIDE { |
| 81 return true; | 79 return true; |
| 82 } | 80 } |
| 83 | 81 |
| 84 virtual bool OnResponseStarted(int request_id, | 82 virtual bool OnResponseStarted(int request_id, |
| 85 ResourceResponse* response, | 83 ResourceResponse* response, |
| 86 bool* defer) OVERRIDE { return true; } | 84 bool* defer) OVERRIDE { return true; } |
| 87 | 85 |
| 88 virtual bool OnWillStart(int request_id, | 86 virtual bool OnWillStart(int request_id, |
| 89 const GURL& url, | 87 const GURL& url, |
| 90 bool* defer) OVERRIDE { | 88 bool* defer) OVERRIDE { |
| 91 return true; | 89 return true; |
| 92 } | 90 } |
| 93 | 91 |
| 94 virtual bool OnWillRead(int request_id, | 92 virtual bool OnWillRead(int request_id, |
| 95 scoped_refptr<net::IOBuffer>* buf, | 93 net::IOBuffer** buf, |
| 96 int* buf_size, | 94 int* buf_size, |
| 97 int min_size) OVERRIDE { | 95 int min_size) OVERRIDE { |
| 98 return true; | 96 return true; |
| 99 } | 97 } |
| 100 | 98 |
| 101 virtual bool OnReadCompleted(int request_id, | 99 virtual bool OnReadCompleted(int request_id, |
| 102 int bytes_read, | 100 int bytes_read, |
| 103 bool* defer) OVERRIDE { | 101 bool* defer) OVERRIDE { |
| 104 return true; | 102 return true; |
| 105 } | 103 } |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 EXPECT_EQ(dummy_authority, raw_ptr_to_store->requested_authorities()); | 244 EXPECT_EQ(dummy_authority, raw_ptr_to_store->requested_authorities()); |
| 247 | 245 |
| 248 // Check if the retrieved certificates were passed to the content browser | 246 // Check if the retrieved certificates were passed to the content browser |
| 249 // client. | 247 // client. |
| 250 EXPECT_EQ(1, test_client.call_count()); | 248 EXPECT_EQ(1, test_client.call_count()); |
| 251 EXPECT_EQ(dummy_certs, test_client.passed_certs()); | 249 EXPECT_EQ(dummy_certs, test_client.passed_certs()); |
| 252 } | 250 } |
| 253 #endif // !defined(OPENSSL) | 251 #endif // !defined(OPENSSL) |
| 254 | 252 |
| 255 } // namespace content | 253 } // namespace content |
| OLD | NEW |