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

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

Issue 9958028: Add a new GetNegotiatedProtocol method to StreamSocket and implement in all subclasses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup Created 8 years, 8 months 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
OLDNEW
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/socket/client_socket_pool_base.h" 5 #include "net/socket/client_socket_pool_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 virtual bool WasEverUsed() const { 96 virtual bool WasEverUsed() const {
97 return was_used_to_convey_data_ || num_bytes_read_ > 0; 97 return was_used_to_convey_data_ || num_bytes_read_ > 0;
98 } 98 }
99 virtual bool UsingTCPFastOpen() const { return false; } 99 virtual bool UsingTCPFastOpen() const { return false; }
100 virtual int64 NumBytesRead() const { return num_bytes_read_; } 100 virtual int64 NumBytesRead() const { return num_bytes_read_; }
101 virtual base::TimeDelta GetConnectTimeMicros() const { 101 virtual base::TimeDelta GetConnectTimeMicros() const {
102 static const base::TimeDelta kDummyConnectTimeMicros = 102 static const base::TimeDelta kDummyConnectTimeMicros =
103 base::TimeDelta::FromMicroseconds(10); 103 base::TimeDelta::FromMicroseconds(10);
104 return kDummyConnectTimeMicros; // Dummy value. 104 return kDummyConnectTimeMicros; // Dummy value.
105 } 105 }
106 virtual NextProto GetNegotiatedProtocol() const {
107 return kProtoUnknown;
108 }
106 109
107 private: 110 private:
108 bool connected_; 111 bool connected_;
109 BoundNetLog net_log_; 112 BoundNetLog net_log_;
110 bool was_used_to_convey_data_; 113 bool was_used_to_convey_data_;
111 int num_bytes_read_; 114 int num_bytes_read_;
112 115
113 DISALLOW_COPY_AND_ASSIGN(MockClientSocket); 116 DISALLOW_COPY_AND_ASSIGN(MockClientSocket);
114 }; 117 };
115 118
(...skipping 3245 matching lines...) Expand 10 before | Expand all | Expand 10 after
3361 // The hung connect job should still be there, but everything else should be 3364 // The hung connect job should still be there, but everything else should be
3362 // complete. 3365 // complete.
3363 EXPECT_EQ(1, pool_->NumConnectJobsInGroup("a")); 3366 EXPECT_EQ(1, pool_->NumConnectJobsInGroup("a"));
3364 EXPECT_EQ(0, pool_->IdleSocketCountInGroup("a")); 3367 EXPECT_EQ(0, pool_->IdleSocketCountInGroup("a"));
3365 EXPECT_EQ(1, pool_->NumActiveSocketsInGroup("a")); 3368 EXPECT_EQ(1, pool_->NumActiveSocketsInGroup("a"));
3366 } 3369 }
3367 3370
3368 } // namespace 3371 } // namespace
3369 3372
3370 } // namespace net 3373 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698