| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/dns/dns_transaction.h" | 5 #include "net/dns/dns_transaction.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 const net::NetLog::Source& source) override { | 191 const net::NetLog::Source& source) override { |
| 192 if (fail_next_socket_) { | 192 if (fail_next_socket_) { |
| 193 fail_next_socket_ = false; | 193 fail_next_socket_ = false; |
| 194 return scoped_ptr<DatagramClientSocket>( | 194 return scoped_ptr<DatagramClientSocket>( |
| 195 new FailingUDPClientSocket(&empty_data_, net_log)); | 195 new FailingUDPClientSocket(&empty_data_, net_log)); |
| 196 } | 196 } |
| 197 SocketDataProvider* data_provider = mock_data().GetNext(); | 197 SocketDataProvider* data_provider = mock_data().GetNext(); |
| 198 scoped_ptr<TestUDPClientSocket> socket( | 198 scoped_ptr<TestUDPClientSocket> socket( |
| 199 new TestUDPClientSocket(this, data_provider, net_log)); | 199 new TestUDPClientSocket(this, data_provider, net_log)); |
| 200 data_provider->set_socket(socket.get()); | 200 data_provider->set_socket(socket.get()); |
| 201 return socket.PassAs<DatagramClientSocket>(); | 201 return socket.Pass(); |
| 202 } | 202 } |
| 203 | 203 |
| 204 void OnConnect(const IPEndPoint& endpoint) { | 204 void OnConnect(const IPEndPoint& endpoint) { |
| 205 remote_endpoints_.push_back(endpoint); | 205 remote_endpoints_.push_back(endpoint); |
| 206 } | 206 } |
| 207 | 207 |
| 208 std::vector<IPEndPoint> remote_endpoints_; | 208 std::vector<IPEndPoint> remote_endpoints_; |
| 209 bool fail_next_socket_; | 209 bool fail_next_socket_; |
| 210 | 210 |
| 211 private: | 211 private: |
| (...skipping 790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 config_.timeout = TestTimeouts::tiny_timeout(); | 1002 config_.timeout = TestTimeouts::tiny_timeout(); |
| 1003 ConfigureFactory(); | 1003 ConfigureFactory(); |
| 1004 | 1004 |
| 1005 TransactionHelper helper0(".", dns_protocol::kTypeA, ERR_INVALID_ARGUMENT); | 1005 TransactionHelper helper0(".", dns_protocol::kTypeA, ERR_INVALID_ARGUMENT); |
| 1006 EXPECT_TRUE(helper0.Run(transaction_factory_.get())); | 1006 EXPECT_TRUE(helper0.Run(transaction_factory_.get())); |
| 1007 } | 1007 } |
| 1008 | 1008 |
| 1009 } // namespace | 1009 } // namespace |
| 1010 | 1010 |
| 1011 } // namespace net | 1011 } // namespace net |
| OLD | NEW |