OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/socket/socks_client_socket.h" | 5 #include "net/socket/socks_client_socket.h" |
6 | 6 |
7 #include "net/base/address_list.h" | 7 #include "net/base/address_list.h" |
8 #include "net/base/net_log.h" | 8 #include "net/base/net_log.h" |
9 #include "net/base/net_log_unittest.h" | 9 #include "net/base/net_log_unittest.h" |
10 #include "net/base/mock_host_resolver.h" | 10 #include "net/base/mock_host_resolver.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 NOTIMPLEMENTED(); | 104 NOTIMPLEMENTED(); |
105 return ERR_UNEXPECTED; | 105 return ERR_UNEXPECTED; |
106 } | 106 } |
107 | 107 |
108 virtual void CancelRequest(RequestHandle req) OVERRIDE { | 108 virtual void CancelRequest(RequestHandle req) OVERRIDE { |
109 EXPECT_TRUE(HasOutstandingRequest()); | 109 EXPECT_TRUE(HasOutstandingRequest()); |
110 EXPECT_EQ(outstanding_request_, req); | 110 EXPECT_EQ(outstanding_request_, req); |
111 outstanding_request_ = NULL; | 111 outstanding_request_ = NULL; |
112 } | 112 } |
113 | 113 |
114 virtual void AddObserver(Observer* observer) OVERRIDE {} | |
115 virtual void RemoveObserver(Observer* observer) OVERRIDE {} | |
116 | |
117 bool HasOutstandingRequest() { | 114 bool HasOutstandingRequest() { |
118 return outstanding_request_ != NULL; | 115 return outstanding_request_ != NULL; |
119 } | 116 } |
120 | 117 |
121 private: | 118 private: |
122 RequestHandle outstanding_request_; | 119 RequestHandle outstanding_request_; |
123 | 120 |
124 DISALLOW_COPY_AND_ASSIGN(HangingHostResolverWithCancel); | 121 DISALLOW_COPY_AND_ASSIGN(HangingHostResolverWithCancel); |
125 }; | 122 }; |
126 | 123 |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 // Disconnect the SOCKS socket -- this should cancel the outstanding resolve. | 394 // Disconnect the SOCKS socket -- this should cancel the outstanding resolve. |
398 user_sock_->Disconnect(); | 395 user_sock_->Disconnect(); |
399 | 396 |
400 EXPECT_FALSE(hanging_resolver->HasOutstandingRequest()); | 397 EXPECT_FALSE(hanging_resolver->HasOutstandingRequest()); |
401 | 398 |
402 EXPECT_FALSE(user_sock_->IsConnected()); | 399 EXPECT_FALSE(user_sock_->IsConnected()); |
403 EXPECT_FALSE(user_sock_->IsConnectedAndIdle()); | 400 EXPECT_FALSE(user_sock_->IsConnectedAndIdle()); |
404 } | 401 } |
405 | 402 |
406 } // namespace net | 403 } // namespace net |
OLD | NEW |