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

Unified Diff: remoting/host/chromoting_host_unittest.cc

Issue 1460593005: Make protocol::ConnectionToClient an abstract interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/host/chromoting_host_unittest.cc
diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc
index 6cbc4eac6e86c52aed1a1682d5a3bfa306cc7519..e8202239b8e3f3ed8383a34e8190bda356178d22 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.

Powered by Google App Engine
This is Rietveld 408576698