Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1703)

Unified Diff: chrome/browser/local_discovery/privet_notifications_unittest.cc

Issue 948413006: Move callback and host port args into Start method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no_sdc
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/local_discovery/privet_notifications_unittest.cc
diff --git a/chrome/browser/local_discovery/privet_notifications_unittest.cc b/chrome/browser/local_discovery/privet_notifications_unittest.cc
index 6e6496c856b11621d800fdd5b77f803aa90422ef..089e3aa2615112abf6ce6bccbf5ce043926125b6 100644
--- a/chrome/browser/local_discovery/privet_notifications_unittest.cc
+++ b/chrome/browser/local_discovery/privet_notifications_unittest.cc
@@ -41,17 +41,15 @@ class MockPrivetHttpFactory : public PrivetHTTPAsynchronousFactory {
public:
class MockResolution : public PrivetHTTPResolution {
public:
- MockResolution(
- const std::string& name,
- net::URLRequestContextGetter* request_context,
- const ResultCallback& callback)
- : name_(name), request_context_(request_context), callback_(callback) {
- }
+ MockResolution(const std::string& name,
+ net::URLRequestContextGetter* request_context)
+ : name_(name), request_context_(request_context) {}
~MockResolution() override {}
- void Start() override {
- callback_.Run(scoped_ptr<PrivetHTTPClient>(new PrivetHTTPClientImpl(
+ void Start(const net::HostPortPair& address,
+ const ResultCallback& callback) override {
+ callback.Run(scoped_ptr<PrivetHTTPClient>(new PrivetHTTPClientImpl(
name_, net::HostPortPair("1.2.3.4", 8080), request_context_.get())));
}
@@ -60,7 +58,6 @@ class MockPrivetHttpFactory : public PrivetHTTPAsynchronousFactory {
private:
std::string name_;
scoped_refptr<net::URLRequestContextGetter> request_context_;
- ResultCallback callback_;
};
explicit MockPrivetHttpFactory(net::URLRequestContextGetter* request_context)
@@ -68,11 +65,9 @@ class MockPrivetHttpFactory : public PrivetHTTPAsynchronousFactory {
}
scoped_ptr<PrivetHTTPResolution> CreatePrivetHTTP(
- const std::string& name,
- const net::HostPortPair& address,
- const ResultCallback& callback) override {
+ const std::string& name) override {
return scoped_ptr<PrivetHTTPResolution>(
- new MockResolution(name, request_context_.get(), callback));
+ new MockResolution(name, request_context_.get()));
}
private:

Powered by Google App Engine
This is Rietveld 408576698