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

Unified Diff: remoting/protocol/connection_tester.h

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_unittest.cc ('k') | remoting/protocol/connection_tester.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/connection_tester.h
diff --git a/remoting/protocol/connection_tester.h b/remoting/protocol/connection_tester.h
index de63a62da50cfc900f77749efd6f5ddc87d9c711..59ce49e64eb70ba402aed16b5b4d4c68b7559cc3 100644
--- a/remoting/protocol/connection_tester.h
+++ b/remoting/protocol/connection_tester.h
@@ -5,13 +5,16 @@
#ifndef REMOTING_PROTOCOL_CONNECTION_TESTER_H_
#define REMOTING_PROTOCOL_CONNECTION_TESTER_H_
+#include <list>
#include <vector>
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/run_loop.h"
namespace base {
class MessageLoop;
-}
+} // namespace base
namespace net {
class DrainableIOBuffer;
@@ -20,8 +23,13 @@ class IOBuffer;
} // namespace net
namespace remoting {
+
+class CompoundBuffer;
+class VideoPacket;
+
namespace protocol {
+class MessagePipe;
class P2PDatagramSocket;
class P2PStreamSocket;
@@ -104,6 +112,30 @@ class DatagramConnectionTester {
int bad_packets_received_;
};
+class MessagePipeConnectionTester {
+ public:
+ MessagePipeConnectionTester(MessagePipe* client_pipe,
+ MessagePipe* host_pipe,
+ int message_size,
+ int message_count);
+ ~MessagePipeConnectionTester();
+
+ void RunAndCheckResults();
+
+ protected:
+ void OnMessageReceived(scoped_ptr<CompoundBuffer> message);
+
+ private:
+ base::RunLoop run_loop_;
+ MessagePipe* host_pipe_;
+ MessagePipe* client_pipe_;
+ int message_size_;
+ int message_count_;
+
+ std::vector<scoped_ptr<VideoPacket>> sent_messages_;
+ std::vector<scoped_ptr<VideoPacket>> received_messages_;
+};
+
} // namespace protocol
} // namespace remoting
« no previous file with comments | « remoting/protocol/client_video_dispatcher_unittest.cc ('k') | remoting/protocol/connection_tester.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698