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

Side by Side Diff: chrome/browser/extensions/api/socket/tls_socket_unittest.cc

Issue 1376473003: Notify NQE of TCP RTT values (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added throttle on TCP socket notifications (with tests) Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <deque> 8 #include <deque>
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 MOCK_CONST_METHOD0(GetSSLFailureState, net::SSLFailureState()); 78 MOCK_CONST_METHOD0(GetSSLFailureState, net::SSLFailureState());
79 bool IsConnected() const override { return true; } 79 bool IsConnected() const override { return true; }
80 80
81 private: 81 private:
82 DISALLOW_COPY_AND_ASSIGN(MockSSLClientSocket); 82 DISALLOW_COPY_AND_ASSIGN(MockSSLClientSocket);
83 }; 83 };
84 84
85 class MockTCPSocket : public net::TCPClientSocket { 85 class MockTCPSocket : public net::TCPClientSocket {
86 public: 86 public:
87 explicit MockTCPSocket(const net::AddressList& address_list) 87 explicit MockTCPSocket(const net::AddressList& address_list)
88 : net::TCPClientSocket(address_list, NULL, net::NetLog::Source()) {} 88 : net::TCPClientSocket(address_list, NULL, NULL, net::NetLog::Source()) {}
89 89
90 MOCK_METHOD3(Read, 90 MOCK_METHOD3(Read,
91 int(net::IOBuffer* buf, 91 int(net::IOBuffer* buf,
92 int buf_len, 92 int buf_len,
93 const net::CompletionCallback& callback)); 93 const net::CompletionCallback& callback));
94 MOCK_METHOD3(Write, 94 MOCK_METHOD3(Write,
95 int(net::IOBuffer* buf, 95 int(net::IOBuffer* buf,
96 int buf_len, 96 int buf_len,
97 const net::CompletionCallback& callback)); 97 const net::CompletionCallback& callback));
98 MOCK_METHOD2(SetKeepAlive, bool(bool enable, int delay)); 98 MOCK_METHOD2(SetKeepAlive, bool(bool enable, int delay));
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 total_bytes_written += amount_written_invocation; 314 total_bytes_written += amount_written_invocation;
315 cb.first.Run(amount_written_invocation); 315 cb.first.Run(amount_written_invocation);
316 } 316 }
317 317
318 ASSERT_EQ(total_bytes_requested, total_bytes_written) 318 ASSERT_EQ(total_bytes_requested, total_bytes_written)
319 << "There should be exactly as many bytes written as originally " 319 << "There should be exactly as many bytes written as originally "
320 << "requested to Write()."; 320 << "requested to Write().";
321 } 321 }
322 322
323 } // namespace extensions 323 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698