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

Unified Diff: remoting/host/client_session_unittest.cc

Issue 2967793002: [Chromoting] Remove DataChannelManagerCallbacks constructor parameter of ClientSession (Closed)
Patch Set: Resolve review comments Created 3 years, 5 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/client_session.cc ('k') | remoting/protocol/data_channel_manager.h » ('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 75308007e4f086b668950c15af06140e88b20822..0bd7b350fe951b68fac2bd5b525678dfe31c4ffa 100644
--- a/remoting/host/client_session_unittest.cc
+++ b/remoting/host/client_session_unittest.cc
@@ -135,9 +135,6 @@ class ClientSessionTest : public testing::Test {
// ownership of the HostExtensions themselves.
std::vector<HostExtension*> extensions_;
- std::vector<protocol::DataChannelManager::NameCallbackPair>
- data_channel_callbacks_;
-
// ClientSession instance under test.
std::unique_ptr<ClientSession> client_session_;
@@ -190,7 +187,7 @@ void ClientSessionTest::CreateClientSession(
&session_event_handler_, std::move(connection),
desktop_environment_factory_.get(),
DesktopEnvironmentOptions::CreateDefault(), base::TimeDelta(), nullptr,
- extensions_, data_channel_callbacks_));
+ extensions_));
}
void ClientSessionTest::CreateClientSession() {
@@ -438,15 +435,13 @@ TEST_F(ClientSessionTest, Extensions) {
TEST_F(ClientSessionTest, DataChannelCallbackIsCalled) {
bool callback_called = false;
- data_channel_callbacks_.push_back(
- protocol::DataChannelManager::NameCallbackPair(
- kTestDataChannelCallbackName,
- base::Bind([](bool* callback_was_called, const std::string& name,
- std::unique_ptr<protocol::MessagePipe> pipe)
- -> void { *callback_was_called = true; },
- &callback_called)));
-
CreateClientSession();
+ client_session_->RegisterCreateHandlerCallbackForTesting(
+ kTestDataChannelCallbackName,
+ base::Bind([](bool* callback_was_called, const std::string& name,
+ std::unique_ptr<protocol::MessagePipe> pipe)
+ -> void { *callback_was_called = true; },
+ &callback_called));
ConnectClientSession();
std::unique_ptr<protocol::MessagePipe> pipe =
« no previous file with comments | « remoting/host/client_session.cc ('k') | remoting/protocol/data_channel_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698