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

Side by Side Diff: remoting/signaling/xmpp_signal_strategy_unittest.cc

Issue 1114353005: Revert of Add AllReadDataConsumed and AllWriteDataConsumed methods to SocketDataProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « remoting/base/buffered_socket_writer_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "remoting/signaling/xmpp_signal_strategy.h" 5 #include "remoting/signaling/xmpp_signal_strategy.h"
6 6
7 #include "base/base64.h" 7 #include "base/base64.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "net/socket/socket_test_util.h" 10 #include "net/socket/socket_test_util.h"
(...skipping 11 matching lines...) Expand all
22 return net::MockRead(net::ASYNC, net::ERR_IO_PENDING); 22 return net::MockRead(net::ASYNC, net::ERR_IO_PENDING);
23 } 23 }
24 24
25 net::MockWriteResult OnWrite(const std::string& data) override { 25 net::MockWriteResult OnWrite(const std::string& data) override {
26 written_data_.append(data); 26 written_data_.append(data);
27 return net::MockWriteResult(net::SYNCHRONOUS, data.size()); 27 return net::MockWriteResult(net::SYNCHRONOUS, data.size());
28 } 28 }
29 29
30 void Reset() override {} 30 void Reset() override {}
31 31
32 bool AllReadDataConsumed() const override {
33 return true;
34 }
35
36 bool AllWriteDataConsumed() const override {
37 return true;
38 }
39
40 void ReceiveData(const std::string& text) { 32 void ReceiveData(const std::string& text) {
41 socket()->OnReadComplete( 33 socket()->OnReadComplete(
42 net::MockRead(net::ASYNC, text.data(), text.size())); 34 net::MockRead(net::ASYNC, text.data(), text.size()));
43 } 35 }
44 36
45 void Close() { 37 void Close() {
46 ReceiveData(std::string()); 38 ReceiveData(std::string());
47 } 39 }
48 40
49 void SimulateNetworkError() { 41 void SimulateNetworkError() {
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 259
268 // Can't send messages anymore. 260 // Can't send messages anymore.
269 EXPECT_FALSE(signal_strategy_->SendStanza(make_scoped_ptr( 261 EXPECT_FALSE(signal_strategy_->SendStanza(make_scoped_ptr(
270 new buzz::XmlElement(buzz::QName(std::string(), "hello"))))); 262 new buzz::XmlElement(buzz::QName(std::string(), "hello")))));
271 263
272 // Try connecting again. 264 // Try connecting again.
273 Connect(true); 265 Connect(true);
274 } 266 }
275 267
276 } // namespace remoting 268 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/base/buffered_socket_writer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698