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

Unified Diff: remoting/protocol/channel_multiplexer_unittest.cc

Issue 580243003: Cleanup Fake* classes in remoting/protocol (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sctp
Patch Set: Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: remoting/protocol/channel_multiplexer_unittest.cc
diff --git a/remoting/protocol/channel_multiplexer_unittest.cc b/remoting/protocol/channel_multiplexer_unittest.cc
index 8132d32d990893103295b6e84425f18de807061c..d230f35354ca25cc0407b1f8340c623bc1c99e81 100644
--- a/remoting/protocol/channel_multiplexer_unittest.cc
+++ b/remoting/protocol/channel_multiplexer_unittest.cc
@@ -72,18 +72,21 @@ class ChannelMultiplexerTest : public testing::Test {
protected:
virtual void SetUp() OVERRIDE {
// Create pair of multiplexers and connect them to each other.
- host_mux_.reset(new ChannelMultiplexer(&host_session_, kMuxChannelName));
- client_mux_.reset(new ChannelMultiplexer(&client_session_,
- kMuxChannelName));
+ host_mux_.reset(new ChannelMultiplexer(
+ host_session_.GetTransportChannelFactory(), kMuxChannelName));
+ client_mux_.reset(new ChannelMultiplexer(
+ client_session_.GetTransportChannelFactory(), kMuxChannelName));
}
// Connect sockets to each other. Must be called after we've created at least
// one channel with each multiplexer.
void ConnectSockets() {
- FakeSocket* host_socket =
- host_session_.GetStreamChannel(ChannelMultiplexer::kMuxChannelName);
- FakeSocket* client_socket =
- client_session_.GetStreamChannel(ChannelMultiplexer::kMuxChannelName);
+ FakeStreamSocket* host_socket =
+ host_session_.fake_channel_factory().GetFakeChannel(
+ ChannelMultiplexer::kMuxChannelName);
+ FakeStreamSocket* client_socket =
+ client_session_.fake_channel_factory().GetFakeChannel(
+ ChannelMultiplexer::kMuxChannelName);
host_socket->PairWith(client_socket);
// Make writes asynchronous in one direction.
@@ -242,9 +245,9 @@ TEST_F(ChannelMultiplexerTest, WriteFailSync) {
ConnectSockets();
- host_session_.GetStreamChannel(kMuxChannelName)->
+ host_session_.fake_channel_factory().GetFakeChannel(kMuxChannelName)->
set_next_write_error(net::ERR_FAILED);
- host_session_.GetStreamChannel(kMuxChannelName)->
+ host_session_.fake_channel_factory().GetFakeChannel(kMuxChannelName)->
set_async_write(false);
scoped_refptr<net::IOBufferWithSize> buf = CreateTestBuffer(100);
@@ -280,9 +283,9 @@ TEST_F(ChannelMultiplexerTest, WriteFailAsync) {
ConnectSockets();
- host_session_.GetStreamChannel(kMuxChannelName)->
+ host_session_.fake_channel_factory().GetFakeChannel(kMuxChannelName)->
set_next_write_error(net::ERR_FAILED);
- host_session_.GetStreamChannel(kMuxChannelName)->
+ host_session_.fake_channel_factory().GetFakeChannel(kMuxChannelName)->
set_async_write(true);
scoped_refptr<net::IOBufferWithSize> buf = CreateTestBuffer(100);
@@ -314,9 +317,9 @@ TEST_F(ChannelMultiplexerTest, DeleteWhenFailed) {
ConnectSockets();
- host_session_.GetStreamChannel(kMuxChannelName)->
+ host_session_.fake_channel_factory().GetFakeChannel(kMuxChannelName)->
set_next_write_error(net::ERR_FAILED);
- host_session_.GetStreamChannel(kMuxChannelName)->
+ host_session_.fake_channel_factory().GetFakeChannel(kMuxChannelName)->
set_async_write(true);
scoped_refptr<net::IOBufferWithSize> buf = CreateTestBuffer(100);
@@ -349,8 +352,8 @@ TEST_F(ChannelMultiplexerTest, DeleteWhenFailed) {
}
TEST_F(ChannelMultiplexerTest, SessionFail) {
- host_session_.set_async_creation(true);
- host_session_.set_error(AUTHENTICATION_FAILED);
+ host_session_.fake_channel_factory().set_asynchronous_create(true);
+ host_session_.fake_channel_factory().set_fail_create(true);
MockConnectCallback cb1;
MockConnectCallback cb2;
« no previous file with comments | « remoting/protocol/buffered_socket_writer_unittest.cc ('k') | remoting/protocol/connection_to_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698