OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |