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

Side by Side Diff: net/proxy/proxy_service_mojo_unittest.cc

Issue 2116983002: Change HostResolver::Resolve() to take an std::unique_ptr<Request>* rather than a RequestHandle* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: changed implementation of attach/detach of request Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "net/proxy/proxy_service_mojo.h" 5 #include "net/proxy/proxy_service_mojo.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 ASSERT_TRUE(entries[i].GetIntegerValue("line_number", &line_number)); 107 ASSERT_TRUE(entries[i].GetIntegerValue("line_number", &line_number));
108 EXPECT_EQ(3, line_number); 108 EXPECT_EQ(3, line_number);
109 } 109 }
110 110
111 class LoggingMockHostResolver : public MockHostResolver { 111 class LoggingMockHostResolver : public MockHostResolver {
112 public: 112 public:
113 int Resolve(const RequestInfo& info, 113 int Resolve(const RequestInfo& info,
114 RequestPriority priority, 114 RequestPriority priority,
115 AddressList* addresses, 115 AddressList* addresses,
116 const CompletionCallback& callback, 116 const CompletionCallback& callback,
117 RequestHandle* out_req, 117 std::unique_ptr<Request>* out_req,
118 const BoundNetLog& net_log) override { 118 const BoundNetLog& net_log) override {
119 net_log.AddEvent(NetLog::TYPE_HOST_RESOLVER_IMPL_JOB); 119 net_log.AddEvent(NetLog::TYPE_HOST_RESOLVER_IMPL_JOB);
120 return MockHostResolver::Resolve(info, priority, addresses, callback, 120 return MockHostResolver::Resolve(info, priority, addresses, callback,
121 out_req, net_log); 121 out_req, net_log);
122 } 122 }
123 }; 123 };
124 124
125 } // namespace 125 } // namespace
126 126
127 class ProxyServiceMojoTest : public testing::Test, 127 class ProxyServiceMojoTest : public testing::Test,
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 EXPECT_THAT(callback.WaitForResult(), IsOk()); 258 EXPECT_THAT(callback.WaitForResult(), IsOk());
259 EXPECT_EQ("DIRECT", info.ToPacString()); 259 EXPECT_EQ("DIRECT", info.ToPacString());
260 EXPECT_EQ(0u, mock_host_resolver_.num_resolve()); 260 EXPECT_EQ(0u, mock_host_resolver_.num_resolve());
261 261
262 TestNetLogEntry::List entries; 262 TestNetLogEntry::List entries;
263 net_log_.GetEntries(&entries); 263 net_log_.GetEntries(&entries);
264 CheckCapturedNetLogEntries(entries); 264 CheckCapturedNetLogEntries(entries);
265 } 265 }
266 266
267 } // namespace net 267 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698