| OLD | NEW |
| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 ASSERT_TRUE(entries[i].GetIntegerValue("line_number", &line_number)); | 106 ASSERT_TRUE(entries[i].GetIntegerValue("line_number", &line_number)); |
| 107 EXPECT_EQ(3, line_number); | 107 EXPECT_EQ(3, line_number); |
| 108 } | 108 } |
| 109 | 109 |
| 110 class LoggingMockHostResolver : public MockHostResolver { | 110 class LoggingMockHostResolver : public MockHostResolver { |
| 111 public: | 111 public: |
| 112 int Resolve(const RequestInfo& info, | 112 int Resolve(const RequestInfo& info, |
| 113 RequestPriority priority, | 113 RequestPriority priority, |
| 114 AddressList* addresses, | 114 AddressList* addresses, |
| 115 const CompletionCallback& callback, | 115 const CompletionCallback& callback, |
| 116 RequestHandle* out_req, | 116 std::unique_ptr<Request>* out_req, |
| 117 const BoundNetLog& net_log) override { | 117 const BoundNetLog& net_log) override { |
| 118 net_log.AddEvent(NetLog::TYPE_HOST_RESOLVER_IMPL_JOB); | 118 net_log.AddEvent(NetLog::TYPE_HOST_RESOLVER_IMPL_JOB); |
| 119 return MockHostResolver::Resolve(info, priority, addresses, callback, | 119 return MockHostResolver::Resolve(info, priority, addresses, callback, |
| 120 out_req, net_log); | 120 out_req, net_log); |
| 121 } | 121 } |
| 122 }; | 122 }; |
| 123 | 123 |
| 124 } // namespace | 124 } // namespace |
| 125 | 125 |
| 126 class ProxyServiceMojoTest : public testing::Test, | 126 class ProxyServiceMojoTest : public testing::Test, |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 EXPECT_THAT(callback.WaitForResult(), IsOk()); | 257 EXPECT_THAT(callback.WaitForResult(), IsOk()); |
| 258 EXPECT_EQ("DIRECT", info.ToPacString()); | 258 EXPECT_EQ("DIRECT", info.ToPacString()); |
| 259 EXPECT_EQ(0u, mock_host_resolver_.num_resolve()); | 259 EXPECT_EQ(0u, mock_host_resolver_.num_resolve()); |
| 260 | 260 |
| 261 TestNetLogEntry::List entries; | 261 TestNetLogEntry::List entries; |
| 262 net_log_.GetEntries(&entries); | 262 net_log_.GetEntries(&entries); |
| 263 CheckCapturedNetLogEntries(entries); | 263 CheckCapturedNetLogEntries(entries); |
| 264 } | 264 } |
| 265 | 265 |
| 266 } // namespace net | 266 } // namespace net |
| OLD | NEW |