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

Side by Side Diff: net/socket/socks_client_socket_unittest.cc

Issue 8533011: Remove unused HostResolver::Observer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove id from AsyncHostResolver; add double-cancelation check; comments' Created 9 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « net/socket/socks_client_socket_pool.cc ('k') | net/socket/transport_client_socket_pool.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/socket/socks_client_socket_pool.cc ('k') | net/socket/transport_client_socket_pool.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698