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

Unified Diff: remoting/protocol/channel_multiplexer_unittest.cc

Issue 1413813006: Revert of Add TransportSession interface to prepare for WebRTC-based transport. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « remoting/protocol/channel_dispatcher_base.cc ('k') | remoting/protocol/client_video_dispatcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/channel_multiplexer_unittest.cc
diff --git a/remoting/protocol/channel_multiplexer_unittest.cc b/remoting/protocol/channel_multiplexer_unittest.cc
index d8394bf03e4775417835c1685aefb3c4a02b82d8..190764ebc6edc6c5028d9d45ccdc7bc31f4d4037 100644
--- a/remoting/protocol/channel_multiplexer_unittest.cc
+++ b/remoting/protocol/channel_multiplexer_unittest.cc
@@ -73,24 +73,20 @@
void SetUp() override {
// Create pair of multiplexers and connect them to each other.
host_mux_.reset(new ChannelMultiplexer(
- host_session_.GetTransportSession()->GetStreamChannelFactory(),
- kMuxChannelName));
+ host_session_.GetTransportChannelFactory(), kMuxChannelName));
client_mux_.reset(new ChannelMultiplexer(
- client_session_.GetTransportSession()->GetStreamChannelFactory(),
- kMuxChannelName));
+ 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() {
FakeStreamSocket* host_socket =
- host_session_.GetTransportSession()
- ->GetStreamChannelFactory()
- ->GetFakeChannel(ChannelMultiplexer::kMuxChannelName);
+ host_session_.fake_channel_factory().GetFakeChannel(
+ ChannelMultiplexer::kMuxChannelName);
FakeStreamSocket* client_socket =
- client_session_.GetTransportSession()
- ->GetStreamChannelFactory()
- ->GetFakeChannel(ChannelMultiplexer::kMuxChannelName);
+ client_session_.fake_channel_factory().GetFakeChannel(
+ ChannelMultiplexer::kMuxChannelName);
host_socket->PairWith(client_socket);
// Make writes asynchronous in one direction.
@@ -249,11 +245,10 @@
ConnectSockets();
- FakeStreamSocket* socket = host_session_.GetTransportSession()
- ->GetStreamChannelFactory()
- ->GetFakeChannel(kMuxChannelName);
- socket->set_next_write_error(net::ERR_FAILED);
- socket->set_async_write(false);
+ host_session_.fake_channel_factory().GetFakeChannel(kMuxChannelName)->
+ set_next_write_error(net::ERR_FAILED);
+ host_session_.fake_channel_factory().GetFakeChannel(kMuxChannelName)->
+ set_async_write(false);
scoped_refptr<net::IOBufferWithSize> buf = CreateTestBuffer(100);
@@ -285,11 +280,10 @@
ConnectSockets();
- FakeStreamSocket* socket = host_session_.GetTransportSession()
- ->GetStreamChannelFactory()
- ->GetFakeChannel(kMuxChannelName);
- socket->set_next_write_error(net::ERR_FAILED);
- socket->set_async_write(true);
+ host_session_.fake_channel_factory().GetFakeChannel(kMuxChannelName)->
+ set_next_write_error(net::ERR_FAILED);
+ host_session_.fake_channel_factory().GetFakeChannel(kMuxChannelName)->
+ set_async_write(true);
scoped_refptr<net::IOBufferWithSize> buf = CreateTestBuffer(100);
@@ -320,11 +314,10 @@
ConnectSockets();
- FakeStreamSocket* socket = host_session_.GetTransportSession()
- ->GetStreamChannelFactory()
- ->GetFakeChannel(kMuxChannelName);
- socket->set_next_write_error(net::ERR_FAILED);
- socket->set_async_write(true);
+ host_session_.fake_channel_factory().GetFakeChannel(kMuxChannelName)->
+ set_next_write_error(net::ERR_FAILED);
+ host_session_.fake_channel_factory().GetFakeChannel(kMuxChannelName)->
+ set_async_write(true);
scoped_refptr<net::IOBufferWithSize> buf = CreateTestBuffer(100);
@@ -356,10 +349,8 @@
}
TEST_F(ChannelMultiplexerTest, SessionFail) {
- host_session_.GetTransportSession()->GetStreamChannelFactory()
- ->set_asynchronous_create(true);
- host_session_.GetTransportSession()->GetStreamChannelFactory()
- ->set_fail_create(true);
+ 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/channel_dispatcher_base.cc ('k') | remoting/protocol/client_video_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698