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

Unified Diff: remoting/host/chromoting_host_unittest.cc

Issue 7796026: Pass SessionConfig by reference instead of pointer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 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
« no previous file with comments | « remoting/host/chromoting_host.cc ('k') | remoting/protocol/connection_to_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/chromoting_host_unittest.cc
diff --git a/remoting/host/chromoting_host_unittest.cc b/remoting/host/chromoting_host_unittest.cc
index 0842832bd2ee250aebed847b0ee799601b8f5c29..120fb047742a611e55d18ad36ad121fe69fbf0ad 100644
--- a/remoting/host/chromoting_host_unittest.cc
+++ b/remoting/host/chromoting_host_unittest.cc
@@ -112,8 +112,9 @@ class ChromotingHostTest : public testing::Test {
&handler_, &host_stub2_, &event_executor2_);
session_.reset(new MockSession());
session2_.reset(new MockSession());
- session_config_.reset(SessionConfig::CreateDefault());
- session_config2_.reset(SessionConfig::CreateDefault());
+ session_config_ = SessionConfig::GetDefault();
+ session_jid_ = "user@domain/rest-of-jid";
+ session_config2_ = SessionConfig::GetDefault();
ON_CALL(video_stub_, ProcessVideoPacket(_, _))
.WillByDefault(
@@ -134,9 +135,11 @@ class ChromotingHostTest : public testing::Test {
ON_CALL(*connection2_.get(), session())
.WillByDefault(Return(session2_.get()));
ON_CALL(*session_.get(), config())
- .WillByDefault(Return(session_config_.get()));
+ .WillByDefault(ReturnRef(session_config_));
+ ON_CALL(*session_, jid())
+ .WillByDefault(ReturnRef(session_jid_));
ON_CALL(*session2_.get(), config())
- .WillByDefault(Return(session_config2_.get()));
+ .WillByDefault(ReturnRef(session_config2_));
EXPECT_CALL(*connection_.get(), video_stub())
.Times(AnyNumber());
EXPECT_CALL(*connection_.get(), client_stub())
@@ -216,14 +219,15 @@ class ChromotingHostTest : public testing::Test {
MockChromotingHostContext context_;
protocol::LocalLoginCredentials credentials_;
scoped_refptr<MockConnectionToClient> connection_;
+ std::string session_jid_;
scoped_ptr<MockSession> session_;
- scoped_ptr<SessionConfig> session_config_;
+ SessionConfig session_config_;
MockVideoStub video_stub_;
MockClientStub client_stub_;
MockHostStub host_stub_;
scoped_refptr<MockConnectionToClient> connection2_;
scoped_ptr<MockSession> session2_;
- scoped_ptr<SessionConfig> session_config2_;
+ SessionConfig session_config2_;
MockVideoStub video_stub2_;
MockClientStub client_stub2_;
MockHostStub host_stub2_;
@@ -461,7 +465,6 @@ TEST_F(ChromotingHostTest, CurtainModeIT2Me) {
// When the video packet is received we first shutdown ChromotingHost
// then execute the done task.
bool curtain_activated = false;
- std::string mockJid("user@domain/rest-of-jid");
{
Sequence s1, s2;
// Can't just expect Times(0) because if it fails then the host will
@@ -469,10 +472,6 @@ TEST_F(ChromotingHostTest, CurtainModeIT2Me) {
EXPECT_CALL(*curtain_, EnableCurtainMode(_))
.Times(AnyNumber())
.WillRepeatedly(SetBool(&curtain_activated));
- EXPECT_CALL(*session_, jid())
- .Times(1)
- .InSequence(s1)
- .WillOnce(ReturnRef(mockJid));
EXPECT_CALL(*disconnect_window_, Show(_, "user@domain"))
.Times(1)
.InSequence(s1);
« no previous file with comments | « remoting/host/chromoting_host.cc ('k') | remoting/protocol/connection_to_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698