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

Unified Diff: remoting/protocol/channel_multiplexer_unittest.cc

Issue 1420273002: 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 190764ebc6edc6c5028d9d45ccdc7bc31f4d4037..d8394bf03e4775417835c1685aefb3c4a02b82d8 100644
--- a/remoting/protocol/channel_multiplexer_unittest.cc
+++ b/remoting/protocol/channel_multiplexer_unittest.cc
@@ -73,20 +73,24 @@ class ChannelMultiplexerTest : public testing::Test {
void SetUp() override {
// Create pair of multiplexers and connect them to each other.
host_mux_.reset(new ChannelMultiplexer(
- host_session_.GetTransportChannelFactory(), kMuxChannelName));
+ host_session_.GetTransportSession()->GetStreamChannelFactory(),
+ kMuxChannelName));
client_mux_.reset(new ChannelMultiplexer(
- client_session_.GetTransportChannelFactory(), kMuxChannelName));
+ client_session_.GetTransportSession()->GetStreamChannelFactory(),
+ 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_.fake_channel_factory().GetFakeChannel(
- ChannelMultiplexer::kMuxChannelName);
+ host_session_.GetTransportSession()
+ ->GetStreamChannelFactory()
+ ->GetFakeChannel(ChannelMultiplexer::kMuxChannelName);
FakeStreamSocket* client_socket =
- client_session_.fake_channel_factory().GetFakeChannel(
- ChannelMultiplexer::kMuxChannelName);
+ client_session_.GetTransportSession()
+ ->GetStreamChannelFactory()
+ ->GetFakeChannel(ChannelMultiplexer::kMuxChannelName);
host_socket->PairWith(client_socket);
// Make writes asynchronous in one direction.
@@ -245,10 +249,11 @@ TEST_F(ChannelMultiplexerTest, WriteFailSync) {
ConnectSockets();
- 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);
+ FakeStreamSocket* socket = host_session_.GetTransportSession()
+ ->GetStreamChannelFactory()
+ ->GetFakeChannel(kMuxChannelName);
+ socket->set_next_write_error(net::ERR_FAILED);
+ socket->set_async_write(false);
scoped_refptr<net::IOBufferWithSize> buf = CreateTestBuffer(100);
@@ -280,10 +285,11 @@ TEST_F(ChannelMultiplexerTest, WriteFailAsync) {
ConnectSockets();
- 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);
+ FakeStreamSocket* socket = host_session_.GetTransportSession()
+ ->GetStreamChannelFactory()
+ ->GetFakeChannel(kMuxChannelName);
+ socket->set_next_write_error(net::ERR_FAILED);
+ socket->set_async_write(true);
scoped_refptr<net::IOBufferWithSize> buf = CreateTestBuffer(100);
@@ -314,10 +320,11 @@ TEST_F(ChannelMultiplexerTest, DeleteWhenFailed) {
ConnectSockets();
- 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);
+ FakeStreamSocket* socket = host_session_.GetTransportSession()
+ ->GetStreamChannelFactory()
+ ->GetFakeChannel(kMuxChannelName);
+ socket->set_next_write_error(net::ERR_FAILED);
+ socket->set_async_write(true);
scoped_refptr<net::IOBufferWithSize> buf = CreateTestBuffer(100);
@@ -349,8 +356,10 @@ TEST_F(ChannelMultiplexerTest, DeleteWhenFailed) {
}
TEST_F(ChannelMultiplexerTest, SessionFail) {
- host_session_.fake_channel_factory().set_asynchronous_create(true);
- host_session_.fake_channel_factory().set_fail_create(true);
+ host_session_.GetTransportSession()->GetStreamChannelFactory()
+ ->set_asynchronous_create(true);
+ host_session_.GetTransportSession()->GetStreamChannelFactory()
+ ->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