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

Unified Diff: remoting/test/app_remoting_connected_client_fixture.h

Issue 1253613002: Updated latency fixture and refactored connection helper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: "Changed cstdint to stdint.h to compile on mac" Created 5 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/test/BUILD.gn ('k') | remoting/test/app_remoting_connected_client_fixture.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/test/app_remoting_connected_client_fixture.h
diff --git a/remoting/test/app_remoting_connected_client_fixture.h b/remoting/test/app_remoting_connected_client_fixture.h
index 213c24fbf4b1d8d68ff7e4330ec64b1239fe7de5..6d8547c6aa6114dd14c0dbf15ce592077de4e0d8 100644
--- a/remoting/test/app_remoting_connected_client_fixture.h
+++ b/remoting/test/app_remoting_connected_client_fixture.h
@@ -9,6 +9,7 @@
#include "base/callback.h"
#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "remoting/test/remote_connection_observer.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -24,10 +25,15 @@ namespace test {
struct RemoteApplicationDetails;
class AppRemotingConnectionHelper;
+// Allows for custom handling of ExtensionMessage messages.
+typedef base::Callback<void(const protocol::ExtensionMessage& message)>
+ HostMessageReceivedCallback;
+
// Creates a connection to a remote host which is available for tests to use.
// All callbacks must occur on the same thread the object was created on.
class AppRemotingConnectedClientFixture
- : public testing::TestWithParam<const char*> {
+ : public testing::TestWithParam<const char*>,
+ public RemoteConnectionObserver {
public:
AppRemotingConnectedClientFixture();
~AppRemotingConnectedClientFixture() override;
@@ -46,6 +52,12 @@ class AppRemotingConnectedClientFixture
void SetUp() override;
void TearDown() override;
+ // RemoteConnectionObserver interface.
+ void HostMessageReceived(const protocol::ExtensionMessage& message) override;
+
+ // Handles messages from the host.
+ void HandleOnHostMessage(const remoting::protocol::ExtensionMessage& message);
+
// Contains the details for the application being tested.
const RemoteApplicationDetails& application_details_;
@@ -62,6 +74,9 @@ class AppRemotingConnectedClientFixture
// Creates and manages the connection to the remote host.
scoped_ptr<AppRemotingConnectionHelper> connection_helper_;
+ // Called when an ExtensionMessage is received from the host.
+ HostMessageReceivedCallback host_message_received_callback_;
+
DISALLOW_COPY_AND_ASSIGN(AppRemotingConnectedClientFixture);
};
« no previous file with comments | « remoting/test/BUILD.gn ('k') | remoting/test/app_remoting_connected_client_fixture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698