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