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

Unified Diff: remoting/test/app_remoting_test_driver_environment.h

Issue 1008043003: Adding Test Fixture for initial test cases for the App Remoting Test Driver. Also includes the pub… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing 2nd round of feedback Created 5 years, 9 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/app_remoting_test_driver.cc ('k') | remoting/test/app_remoting_test_driver_environment.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/test/app_remoting_test_driver_environment.h
diff --git a/remoting/test/app_remoting_test_driver_environment.h b/remoting/test/app_remoting_test_driver_environment.h
index c814f0b2995d3512232213cabe52dc4539905fa1..eb18a8682333227e86822e1a17e9990bd014c5a6 100644
--- a/remoting/test/app_remoting_test_driver_environment.h
+++ b/remoting/test/app_remoting_test_driver_environment.h
@@ -5,9 +5,12 @@
#ifndef REMOTING_TEST_APP_REMOTING_TEST_DRIVER_ENVIRONMENT_H_
#define REMOTING_TEST_APP_REMOTING_TEST_DRIVER_ENVIRONMENT_H_
+#include <map>
#include <string>
+#include <vector>
#include "base/memory/scoped_ptr.h"
+#include "remoting/test/remote_application_details.h"
#include "remoting/test/remote_host_info_fetcher.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -23,9 +26,8 @@ struct RemoteHostInfo;
// access tokens and retrieving remote host connection information.
class AppRemotingTestDriverEnvironment : public testing::Environment {
public:
- AppRemotingTestDriverEnvironment(
- const std::string& user_name,
- ServiceEnvironment service_environment);
+ AppRemotingTestDriverEnvironment(const std::string& user_name,
+ ServiceEnvironment service_environment);
~AppRemotingTestDriverEnvironment() override;
// Returns false if a valid access token cannot be retrieved.
@@ -37,9 +39,16 @@ class AppRemotingTestDriverEnvironment : public testing::Environment {
// Synchronously request remote host information for |application_id|.
// Returns true if the request was successful and |remote_host_info| is valid.
- bool GetRemoteHostInfoForApplicationId(
- const std::string& application_id,
- RemoteHostInfo* remote_host_info);
+ bool GetRemoteHostInfoForApplicationId(const std::string& application_id,
+ RemoteHostInfo* remote_host_info);
+
+ // Retrieves connection information for all known applications and displays
+ // their availability to STDOUT.
+ void ShowHostAvailability();
+
+ // Provides the RemoteApplicationDetails for the specified |application_name|.
+ const RemoteApplicationDetails& GetDetailsFromAppName(
+ const std::string& application_name);
// Used to set fake/mock objects for AppRemotingTestDriverEnvironment tests.
void SetAccessTokenFetcherForTest(AccessTokenFetcher* access_token_fetcher);
@@ -59,18 +68,25 @@ class AppRemotingTestDriverEnvironment : public testing::Environment {
// Called after the access token fetcher completes.
// The tokens will be empty on failure.
- void OnAccessTokenRetrieved(
- base::Closure done_closure,
- const std::string& access_token,
- const std::string& refresh_token);
+ void OnAccessTokenRetrieved(base::Closure done_closure,
+ const std::string& access_token,
+ const std::string& refresh_token);
// Called after the remote host info fetcher completes.
- // |remote_host_info| is not modified on failure.
+ // |remote_host_info| is modified on failure.
void OnRemoteHostInfoRetrieved(
base::Closure done_closure,
RemoteHostInfo* remote_host_info,
const RemoteHostInfo& retrieved_remote_host_info);
+ // Populates |application_names_| with the names of the supported remote
+ // applications.
+ void PopulateApplicationNames();
+
+ // Populates |application_details_map_| with the RemoteApplicationDetails for
+ // all supported remote applications.
+ void PopulateApplicationDetailsMap();
+
// Used for authenticating with the app remoting service API.
std::string access_token_;
@@ -92,6 +108,12 @@ class AppRemotingTestDriverEnvironment : public testing::Environment {
// RemoteHostInfoFetcher used by TestDriverEnvironment tests.
remoting::test::RemoteHostInfoFetcher* test_remote_host_info_fetcher_;
+ // Contains the names of all supported remote applications.
+ std::vector<std::string> application_names_;
+
+ // Contains RemoteApplicationDetails for all supported remote applications.
+ std::map<std::string, RemoteApplicationDetails> application_details_map_;
+
DISALLOW_COPY_AND_ASSIGN(AppRemotingTestDriverEnvironment);
};
« no previous file with comments | « remoting/test/app_remoting_test_driver.cc ('k') | remoting/test/app_remoting_test_driver_environment.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698