summaryrefslogtreecommitdiffstats
path: root/remoting/host/chromoting_host_unittest.cc
diff options
context:
space:
mode:
authorsergeyu <sergeyu@chromium.org>2015-11-19 14:17:13 -0800
committerCommit bot <commit-bot@chromium.org>2015-11-19 22:18:34 +0000
commitb031cd25bae275aa1668b5850ed1d8e9668f6e41 (patch)
treeaf3706add028d74d756ae8ede6be7294e20a4821 /remoting/host/chromoting_host_unittest.cc
parentb195f41daf755c80d31f964538b1159c81d58e70 (diff)
downloadchromium_src-b031cd25bae275aa1668b5850ed1d8e9668f6e41.zip
chromium_src-b031cd25bae275aa1668b5850ed1d8e9668f6e41.tar.gz
chromium_src-b031cd25bae275aa1668b5850ed1d8e9668f6e41.tar.bz2
Make protocol::ConnectionToClient an abstract interface.
Moved existing code to IceConnectionToClient. In future a new WebrtcConnectionToClient will handle webrtc-based connection. BUG=547158 Review URL: https://codereview.chromium.org/1460593005 Cr-Commit-Position: refs/heads/master@{#360673}
Diffstat (limited to 'remoting/host/chromoting_host_unittest.cc')
-rw-r--r--remoting/host/chromoting_host_unittest.cc20
1 files changed, 4 insertions, 16 deletions
diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc
index 6cbc4ea..e820223 100644
--- a/remoting/host/chromoting_host_unittest.cc
+++ b/remoting/host/chromoting_host_unittest.cc
@@ -118,10 +118,6 @@ class ChromotingHostTest : public testing::Test {
.WillRepeatedly(ReturnRef(session_unowned_jid1_));
EXPECT_CALL(*session_unowned2_, jid())
.WillRepeatedly(ReturnRef(session_unowned_jid2_));
- EXPECT_CALL(*session1_, SetEventHandler(_))
- .Times(AnyNumber());
- EXPECT_CALL(*session2_, SetEventHandler(_))
- .Times(AnyNumber());
EXPECT_CALL(*session_unowned1_, SetEventHandler(_))
.Times(AnyNumber())
.WillRepeatedly(SaveArg<0>(&session_unowned1_event_handler_));
@@ -133,11 +129,11 @@ class ChromotingHostTest : public testing::Test {
EXPECT_CALL(*session2_, config())
.WillRepeatedly(ReturnRef(*session_config2_));
- owned_connection1_.reset(new MockConnectionToClient(session1_,
- &host_stub1_));
+ owned_connection1_.reset(
+ new MockConnectionToClient(make_scoped_ptr(session1_), &host_stub1_));
connection1_ = owned_connection1_.get();
- owned_connection2_.reset(new MockConnectionToClient(session2_,
- &host_stub2_));
+ owned_connection2_.reset(
+ new MockConnectionToClient(make_scoped_ptr(session2_), &host_stub2_));
connection2_ = owned_connection2_.get();
ON_CALL(video_stub1_, ProcessVideoPacketPtr(_, _))
@@ -148,26 +144,18 @@ class ChromotingHostTest : public testing::Test {
.WillByDefault(Return(&video_stub1_));
ON_CALL(*connection1_, client_stub())
.WillByDefault(Return(&client_stub1_));
- ON_CALL(*connection1_, session())
- .WillByDefault(Return(session1_));
ON_CALL(*connection2_, video_stub())
.WillByDefault(Return(&video_stub2_));
ON_CALL(*connection2_, client_stub())
.WillByDefault(Return(&client_stub2_));
- ON_CALL(*connection2_, session())
- .WillByDefault(Return(session2_));
EXPECT_CALL(*connection1_, video_stub())
.Times(AnyNumber());
EXPECT_CALL(*connection1_, client_stub())
.Times(AnyNumber());
- EXPECT_CALL(*connection1_, session())
- .Times(AnyNumber());
EXPECT_CALL(*connection2_, video_stub())
.Times(AnyNumber());
EXPECT_CALL(*connection2_, client_stub())
.Times(AnyNumber());
- EXPECT_CALL(*connection2_, session())
- .Times(AnyNumber());
}
// Helper method to pretend a client is connected to ChromotingHost.