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

Side by Side Diff: jingle/glue/chrome_async_socket_unittest.cc

Issue 1114383003: Add AllReadDataConsumed and AllWriteDataConsumed methods to SocketDataProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 7 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
« no previous file with comments | « no previous file | net/ftp/ftp_network_transaction_unittest.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) 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 "jingle/glue/chrome_async_socket.h" 5 #include "jingle/glue/chrome_async_socket.h"
6 6
7 #include <deque> 7 #include <deque>
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 return; 86 return;
87 } 87 }
88 reads_.push_back(mock_read); 88 reads_.push_back(mock_read);
89 } 89 }
90 90
91 // Simply queues up the given write. 91 // Simply queues up the given write.
92 void AddWrite(const net::MockWrite& mock_write) { 92 void AddWrite(const net::MockWrite& mock_write) {
93 writes_.push_back(mock_write); 93 writes_.push_back(mock_write);
94 } 94 }
95 95
96 bool AllReadDataConsumed() const override {
97 return reads_.empty();
98 }
99
100 bool AllWriteDataConsumed() const override {
101 return writes_.empty();
102 }
103
96 private: 104 private:
97 std::deque<net::MockRead> reads_; 105 std::deque<net::MockRead> reads_;
98 bool has_pending_read_; 106 bool has_pending_read_;
99 107
100 std::deque<net::MockWrite> writes_; 108 std::deque<net::MockWrite> writes_;
101 109
102 DISALLOW_COPY_AND_ASSIGN(AsyncSocketDataProvider); 110 DISALLOW_COPY_AND_ASSIGN(AsyncSocketDataProvider);
103 }; 111 };
104 112
105 class MockXmppClientSocketFactory : public ResolvingClientSocketFactory { 113 class MockXmppClientSocketFactory : public ResolvingClientSocketFactory {
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after
1083 message_loop_->RunUntilIdle(); 1091 message_loop_->RunUntilIdle();
1084 1092
1085 ExpectNoSignal(); 1093 ExpectNoSignal();
1086 1094
1087 DoSSLCloseOpenedNoError(); 1095 DoSSLCloseOpenedNoError();
1088 } 1096 }
1089 1097
1090 } // namespace 1098 } // namespace
1091 1099
1092 } // namespace jingle_glue 1100 } // namespace jingle_glue
OLDNEW
« no previous file with comments | « no previous file | net/ftp/ftp_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698