| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/message_loop.h" | 5 #include "base/message_loop.h" |
| 6 #include "net/base/client_socket.h" | 6 #include "net/base/client_socket.h" |
| 7 #include "net/base/client_socket_handle.h" | 7 #include "net/base/client_socket_handle.h" |
| 8 #include "net/base/client_socket_pool.h" | 8 #include "net/base/client_socket_pool.h" |
| 9 #include "net/base/net_errors.h" | 9 #include "net/base/net_errors.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 public: | 25 public: |
| 26 MockClientSocket() : connected_(false) { | 26 MockClientSocket() : connected_(false) { |
| 27 allocation_count++; | 27 allocation_count++; |
| 28 } | 28 } |
| 29 | 29 |
| 30 // ClientSocket methods: | 30 // ClientSocket methods: |
| 31 virtual int Connect(net::CompletionCallback* callback) { | 31 virtual int Connect(net::CompletionCallback* callback) { |
| 32 connected_ = true; | 32 connected_ = true; |
| 33 return net::OK; | 33 return net::OK; |
| 34 } | 34 } |
| 35 virtual int ReconnectIgnoringLastError(net::CompletionCallback* callback) { | |
| 36 return net::ERR_FAILED; | |
| 37 } | |
| 38 virtual void Disconnect() { | 35 virtual void Disconnect() { |
| 39 connected_ = false; | 36 connected_ = false; |
| 40 } | 37 } |
| 41 virtual bool IsConnected() const { | 38 virtual bool IsConnected() const { |
| 42 return connected_; | 39 return connected_; |
| 43 } | 40 } |
| 44 virtual bool IsConnectedAndIdle() const { | 41 virtual bool IsConnectedAndIdle() const { |
| 45 return connected_; | 42 return connected_; |
| 46 } | 43 } |
| 47 | 44 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 "Request " << kMaxSocketsPerGroup + i << " was not in order."; | 283 "Request " << kMaxSocketsPerGroup + i << " was not in order."; |
| 287 } | 284 } |
| 288 | 285 |
| 289 EXPECT_EQ(request_order_[arraysize(reqs) - 2], | 286 EXPECT_EQ(request_order_[arraysize(reqs) - 2], |
| 290 reqs[arraysize(reqs) - 1].get()) << | 287 reqs[arraysize(reqs) - 1].get()) << |
| 291 "The last request with priority 1 should not have been inserted " | 288 "The last request with priority 1 should not have been inserted " |
| 292 "earlier into the queue."; | 289 "earlier into the queue."; |
| 293 } | 290 } |
| 294 | 291 |
| 295 } // namespace | 292 } // namespace |
| OLD | NEW |