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

Unified Diff: remoting/test/test_chromoting_client_unittest.cc

Issue 1520323007: Simplify ConnectionToHost interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sm_cleanup
Patch Set: Created 5 years 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/test/test_chromoting_client.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6d2522d3599754e73de481435715efbdbd580763 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;
+ 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());
}
« no previous file with comments | « remoting/test/test_chromoting_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698