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

Unified Diff: remoting/protocol/client_video_dispatcher_unittest.cc

Issue 1662673002: Add MessageChanneFactory interface and use it in ChannelDispatcherBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@framing
Patch Set: Created 4 years, 11 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/protocol/client_video_dispatcher.h ('k') | remoting/protocol/connection_tester.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/client_video_dispatcher_unittest.cc
diff --git a/remoting/protocol/client_video_dispatcher_unittest.cc b/remoting/protocol/client_video_dispatcher_unittest.cc
index fb39b46b2d333a631cb9fad34a6aa08f2125c299..73a9c346bc43976b36e5e65e7aed0f57abf11e99 100644
--- a/remoting/protocol/client_video_dispatcher_unittest.cc
+++ b/remoting/protocol/client_video_dispatcher_unittest.cc
@@ -14,6 +14,7 @@
#include "remoting/protocol/fake_stream_socket.h"
#include "remoting/protocol/message_reader.h"
#include "remoting/protocol/message_serialization.h"
+#include "remoting/protocol/stream_message_pipe_adapter.h"
#include "remoting/protocol/video_stub.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -32,20 +33,21 @@ class ClientVideoDispatcherTest : public testing::Test,
// ChannelDispatcherBase::EventHandler interface.
void OnChannelInitialized(ChannelDispatcherBase* channel_dispatcher) override;
- void OnChannelError(ChannelDispatcherBase* channel_dispatcher,
- ErrorCode error) override;
protected:
+ void OnChannelError(int error);
+
void OnMessageReceived(scoped_ptr<CompoundBuffer> buffer);
void OnReadError(int error);
base::MessageLoop message_loop_;
// Set to true in OnChannelInitialized().
- bool initialized_;
+ bool initialized_ = false;
// Client side.
FakeStreamChannelFactory client_channel_factory_;
+ StreamMessageChannelFactoryAdapter channel_factory_adapter_;
ClientVideoDispatcher dispatcher_;
// Host side.
@@ -60,9 +62,12 @@ class ClientVideoDispatcherTest : public testing::Test,
};
ClientVideoDispatcherTest::ClientVideoDispatcherTest()
- : initialized_(false),
+ : channel_factory_adapter_(
+ &client_channel_factory_,
+ base::Bind(&ClientVideoDispatcherTest::OnChannelError,
+ base::Unretained(this))),
dispatcher_(this) {
- dispatcher_.Init(&client_channel_factory_, this);
+ dispatcher_.Init(&channel_factory_adapter_, this);
base::RunLoop().RunUntilIdle();
DCHECK(initialized_);
host_socket_.PairWith(
@@ -89,9 +94,7 @@ void ClientVideoDispatcherTest::OnChannelInitialized(
initialized_ = true;
}
-void ClientVideoDispatcherTest::OnChannelError(
- ChannelDispatcherBase* channel_dispatcher,
- ErrorCode error) {
+void ClientVideoDispatcherTest::OnChannelError(int error) {
// Don't expect channel creation to fail.
FAIL();
}
« no previous file with comments | « remoting/protocol/client_video_dispatcher.h ('k') | remoting/protocol/connection_tester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698