Chromium Code Reviews| Index: remoting/test/test_chromoting_client_unittest.cc |
| diff --git a/remoting/test/test_chromoting_client_unittest.cc b/remoting/test/test_chromoting_client_unittest.cc |
| index 3fe411d6b6e18ea9afd62c977dc87ac7def11440..4462e75221bd90784f039602a4e817699d420a18 100644 |
| --- a/remoting/test/test_chromoting_client_unittest.cc |
| +++ b/remoting/test/test_chromoting_client_unittest.cc |
| @@ -6,15 +6,11 @@ |
| #include "base/message_loop/message_loop.h" |
| #include "remoting/protocol/fake_connection_to_host.h" |
| +#include "remoting/signaling/fake_signal_strategy.h" |
| #include "remoting/test/connection_setup_info.h" |
| #include "remoting/test/test_chromoting_client.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| -namespace { |
| -const char kTestUserName[] = "test_user@faux_address.com"; |
| -const char kAccessToken[] = "faux_access_token"; |
| -} |
| - |
| namespace remoting { |
| namespace test { |
| @@ -36,13 +32,14 @@ class TestChromotingClientTest : public ::testing::Test, |
| void TearDown() override; |
| // Used for result verification. |
| - bool is_connected_to_host_; |
| - protocol::ConnectionToHost::State connection_state_; |
| - protocol::ErrorCode error_code_; |
| + bool is_connected_to_host_ =false; |
|
joedow
2015/12/17 16:59:45
add space -> "= false;"
Sergey Ulanov
2015/12/17 17:32:32
Done.
|
| + protocol::ConnectionToHost::State connection_state_ = |
| + protocol::ConnectionToHost::INITIALIZING; |
| + protocol::ErrorCode error_code_ = protocol::OK; |
| // Used for simulating different conditions for the TestChromotingClient. |
| ConnectionSetupInfo connection_setup_info_; |
| - FakeConnectionToHost* fake_connection_to_host_; |
| + FakeConnectionToHost* fake_connection_to_host_ = nullptr; |
| scoped_ptr<TestChromotingClient> test_chromoting_client_; |
| @@ -57,15 +54,8 @@ class TestChromotingClientTest : public ::testing::Test, |
| DISALLOW_COPY_AND_ASSIGN(TestChromotingClientTest); |
| }; |
| -TestChromotingClientTest::TestChromotingClientTest() |
| - : is_connected_to_host_(false), |
| - connection_state_(protocol::ConnectionToHost::INITIALIZING), |
| - error_code_(protocol::OK), |
| - fake_connection_to_host_(nullptr) { |
| -} |
| - |
| -TestChromotingClientTest::~TestChromotingClientTest() { |
| -} |
| +TestChromotingClientTest::TestChromotingClientTest() {} |
| +TestChromotingClientTest::~TestChromotingClientTest() {} |
| void TestChromotingClientTest::SetUp() { |
| test_chromoting_client_.reset(new TestChromotingClient()); |
| @@ -75,11 +65,12 @@ void TestChromotingClientTest::SetUp() { |
| // keep the ptr around so we can use it to simulate state changes. It will |
| // remain valid until |test_chromoting_client_| is destroyed. |
| fake_connection_to_host_ = new FakeConnectionToHost(); |
| + test_chromoting_client_->SetSignalStrategyForTests(make_scoped_ptr( |
| + new FakeSignalStrategy("test_user@faux_address.com/123"))); |
| test_chromoting_client_->SetConnectionToHostForTests( |
| make_scoped_ptr(fake_connection_to_host_)); |
| - connection_setup_info_.access_token = kAccessToken; |
| - connection_setup_info_.user_name = kTestUserName; |
| + connection_setup_info_.host_jid = "test_host@faux_address.com/321"; |
| connection_setup_info_.auth_methods.push_back( |
| protocol::AuthenticationMethod::ThirdParty()); |
| } |