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

Unified Diff: remoting/host/client_session_unittest.cc

Issue 1463293002: Replace MockConnectionToClient with FakeConnectionToClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_RejectAuthenticatingClient
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
« no previous file with comments | « remoting/host/chromoting_host_unittest.cc ('k') | remoting/protocol/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/client_session_unittest.cc
diff --git a/remoting/host/client_session_unittest.cc b/remoting/host/client_session_unittest.cc
index 5e728ff7934cced8fde0a8e13d3794579f7a6dd7..674b54b2f86810b4dcb6cae4b509ca96f3d3af3f 100644
--- a/remoting/host/client_session_unittest.cc
+++ b/remoting/host/client_session_unittest.cc
@@ -21,6 +21,7 @@
#include "remoting/host/host_extension.h"
#include "remoting/host/host_extension_session.h"
#include "remoting/host/host_mock_objects.h"
+#include "remoting/protocol/fake_connection_to_client.h"
#include "remoting/protocol/fake_desktop_capturer.h"
#include "remoting/protocol/protocol_mock_objects.h"
#include "remoting/protocol/test_event_matchers.h"
@@ -34,7 +35,6 @@
namespace remoting {
using protocol::MockClientStub;
-using protocol::MockConnectionToClient;
using protocol::MockHostStub;
using protocol::MockInputStub;
using protocol::MockSession;
@@ -193,7 +193,7 @@ class ClientSessionTest : public testing::Test {
scoped_ptr<MockInputInjector> input_injector_;
// ClientSession owns |connection_| but tests need it to inject fake events.
- MockConnectionToClient* connection_;
+ protocol::FakeConnectionToClient* connection_;
scoped_ptr<MockDesktopEnvironmentFactory> desktop_environment_factory_;
};
@@ -232,12 +232,10 @@ void ClientSessionTest::CreateClientSession() {
// Mock protocol::ConnectionToClient APIs called directly by ClientSession.
// HostStub is not touched by ClientSession, so we can safely pass nullptr.
- scoped_ptr<MockConnectionToClient> connection(
- new MockConnectionToClient(session.Pass(), nullptr));
- EXPECT_CALL(*connection, client_stub())
- .WillRepeatedly(Return(&client_stub_));
- EXPECT_CALL(*connection, video_stub()).WillRepeatedly(Return(&video_stub_));
- EXPECT_CALL(*connection, Disconnect(_));
+ scoped_ptr<protocol::FakeConnectionToClient> connection(
+ new protocol::FakeConnectionToClient(session.Pass()));
+ connection->set_client_stub(&client_stub_);
+ connection->set_video_stub(&video_stub_);
connection_ = connection.get();
client_session_.reset(new ClientSession(
@@ -257,9 +255,6 @@ void ClientSessionTest::CreateClientSession() {
void ClientSessionTest::DisconnectClientSession() {
client_session_->DisconnectSession(protocol::OK);
- // MockSession won't trigger OnConnectionClosed, so fake it.
- client_session_->OnConnectionClosed(client_session_->connection(),
- protocol::OK);
}
void ClientSessionTest::StopClientSession() {
« no previous file with comments | « remoting/host/chromoting_host_unittest.cc ('k') | remoting/protocol/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698