OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "chrome/browser/local_discovery/privet_http_asynchronous_factory.h" | 5 #include "chrome/browser/local_discovery/privet_http_asynchronous_factory.h" |
6 | 6 |
7 #include "chrome/browser/local_discovery/privet_http_impl.h" | 7 #include "chrome/browser/local_discovery/privet_http_impl.h" |
8 #include "chrome/browser/local_discovery/privet_notifications.h" | 8 #include "chrome/browser/local_discovery/privet_notifications.h" |
9 #include "net/url_request/test_url_fetcher_factory.h" | 9 #include "net/url_request/test_url_fetcher_factory.h" |
10 #include "net/url_request/url_request_test_util.h" | 10 #include "net/url_request/url_request_test_util.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 : name_(name), request_context_(request_context) {} | 46 : name_(name), request_context_(request_context) {} |
47 | 47 |
48 ~MockResolution() override {} | 48 ~MockResolution() override {} |
49 | 49 |
50 void Start(const net::HostPortPair& address, | 50 void Start(const net::HostPortPair& address, |
51 const ResultCallback& callback) override { | 51 const ResultCallback& callback) override { |
52 callback.Run(scoped_ptr<PrivetHTTPClient>(new PrivetHTTPClientImpl( | 52 callback.Run(scoped_ptr<PrivetHTTPClient>(new PrivetHTTPClientImpl( |
53 name_, net::HostPortPair("1.2.3.4", 8080), request_context_.get()))); | 53 name_, net::HostPortPair("1.2.3.4", 8080), request_context_.get()))); |
54 } | 54 } |
55 | 55 |
| 56 void Start(const ResultCallback& callback) override { |
| 57 Start(net::HostPortPair(), callback); |
| 58 } |
| 59 |
56 const std::string& GetName() override { return name_; } | 60 const std::string& GetName() override { return name_; } |
57 | 61 |
58 private: | 62 private: |
59 std::string name_; | 63 std::string name_; |
60 scoped_refptr<net::URLRequestContextGetter> request_context_; | 64 scoped_refptr<net::URLRequestContextGetter> request_context_; |
61 }; | 65 }; |
62 | 66 |
63 explicit MockPrivetHttpFactory(net::URLRequestContextGetter* request_context) | 67 explicit MockPrivetHttpFactory(net::URLRequestContextGetter* request_context) |
64 : request_context_(request_context) { | 68 : request_context_(request_context) { |
65 } | 69 } |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 true, | 207 true, |
204 kExampleDeviceName, | 208 kExampleDeviceName, |
205 description_); | 209 description_); |
206 | 210 |
207 SuccessfulResponseToInfo(kInfoResponseNoUptime); | 211 SuccessfulResponseToInfo(kInfoResponseNoUptime); |
208 } | 212 } |
209 | 213 |
210 } // namespace | 214 } // namespace |
211 | 215 |
212 } // namespace local_discovery | 216 } // namespace local_discovery |
OLD | NEW |