Commit 13648c69 authored by joedow's avatar joedow Committed by Commit bot

Updated the formatting for the app remoting test driver files using...

Updated the formatting for the app remoting test driver files using clag-format for consistency.  No logic changes.

BUG=

Review URL: https://codereview.chromium.org/1037723003

Cr-Commit-Position: refs/heads/master@{#322311}
parent 412f817a
...@@ -33,7 +33,8 @@ AccessTokenFetcher::AccessTokenFetcher() { ...@@ -33,7 +33,8 @@ AccessTokenFetcher::AccessTokenFetcher() {
kOauthRedirectUrl}; kOauthRedirectUrl};
} }
AccessTokenFetcher::~AccessTokenFetcher() {} AccessTokenFetcher::~AccessTokenFetcher() {
}
void AccessTokenFetcher::GetAccessTokenFromAuthCode( void AccessTokenFetcher::GetAccessTokenFromAuthCode(
const std::string& auth_code, const std::string& auth_code,
...@@ -70,12 +71,10 @@ void AccessTokenFetcher::GetAccessTokenFromRefreshToken( ...@@ -70,12 +71,10 @@ void AccessTokenFetcher::GetAccessTokenFromRefreshToken(
// Create a new GaiaOAuthClient for each request to GAIA. // Create a new GaiaOAuthClient for each request to GAIA.
CreateNewGaiaOAuthClientInstance(); CreateNewGaiaOAuthClientInstance();
auth_client_->RefreshToken( auth_client_->RefreshToken(oauth_client_info_, refresh_token_,
oauth_client_info_, std::vector<std::string>(), // scopes
refresh_token_, kMaxGetTokensRetries,
std::vector<std::string>(), // scopes this); // GaiaOAuthClient::Delegate* delegate
kMaxGetTokensRetries,
this); // GaiaOAuthClient::Delegate* delegate
} }
void AccessTokenFetcher::CreateNewGaiaOAuthClientInstance() { void AccessTokenFetcher::CreateNewGaiaOAuthClientInstance() {
...@@ -180,10 +179,8 @@ void AccessTokenFetcher::ValidateAccessToken() { ...@@ -180,10 +179,8 @@ void AccessTokenFetcher::ValidateAccessToken() {
// Create a new GaiaOAuthClient for each request to GAIA. // Create a new GaiaOAuthClient for each request to GAIA.
CreateNewGaiaOAuthClientInstance(); CreateNewGaiaOAuthClientInstance();
auth_client_->GetTokenInfo( auth_client_->GetTokenInfo(access_token_, kMaxGetTokensRetries,
access_token_, this); // GaiaOAuthClient::Delegate* delegate
kMaxGetTokensRetries,
this); // GaiaOAuthClient::Delegate* delegate
} }
} // namespace test } // namespace test
......
...@@ -17,9 +17,9 @@ namespace test { ...@@ -17,9 +17,9 @@ namespace test {
// Supplied by the client for each request to GAIA and returns valid tokens on // Supplied by the client for each request to GAIA and returns valid tokens on
// success or empty tokens on failure. // success or empty tokens on failure.
typedef base::Callback<void( typedef base::Callback<void(const std::string& access_token,
const std::string& access_token, const std::string& refresh_token)>
const std::string& refresh_token)> AccessTokenCallback; AccessTokenCallback;
// Retrieves an access token from either an authorization code or a refresh // Retrieves an access token from either an authorization code or a refresh
// token. Destroying the AccessTokenFetcher while a request is outstanding will // token. Destroying the AccessTokenFetcher while a request is outstanding will
......
...@@ -125,7 +125,7 @@ void AppRemotingConnectedClientFixture::StartConnection() { ...@@ -125,7 +125,7 @@ void AppRemotingConnectedClientFixture::StartConnection() {
// main application window to become visible. // main application window to become visible.
DCHECK(!timer_->IsRunning()); DCHECK(!timer_->IsRunning());
timer_->Start(FROM_HERE, base::TimeDelta::FromSeconds(30), timer_->Start(FROM_HERE, base::TimeDelta::FromSeconds(30),
run_loop_->QuitClosure()); run_loop_->QuitClosure());
client_->StartConnection(AppRemotingSharedData->user_name(), client_->StartConnection(AppRemotingSharedData->user_name(),
AppRemotingSharedData->access_token(), AppRemotingSharedData->access_token(),
...@@ -248,7 +248,7 @@ void AppRemotingConnectedClientFixture::HandleOnWindowAddedMessage( ...@@ -248,7 +248,7 @@ void AppRemotingConnectedClientFixture::HandleOnWindowAddedMessage(
// Now that the main window is visible, give the app some time to settle // Now that the main window is visible, give the app some time to settle
// before signaling that it is ready to run tests. // before signaling that it is ready to run tests.
timer_->Start(FROM_HERE, base::TimeDelta::FromSeconds(2), timer_->Start(FROM_HERE, base::TimeDelta::FromSeconds(2),
run_loop_->QuitClosure()); run_loop_->QuitClosure());
} }
} }
......
...@@ -40,16 +40,17 @@ std::string GetAuthorizationCodeUri() { ...@@ -40,16 +40,17 @@ std::string GetAuthorizationCodeUri() {
bool use_plus = true; bool use_plus = true;
return base::StringPrintf( return base::StringPrintf(
"https://accounts.google.com/o/oauth2/auth" "https://accounts.google.com/o/oauth2/auth"
"?scope=%s" "?scope=%s"
"&redirect_uri=https://chromoting-oauth.talkgadget.google.com/" "&redirect_uri=https://chromoting-oauth.talkgadget.google.com/"
"talkgadget/oauth/chrome-remote-desktop/dev" "talkgadget/oauth/chrome-remote-desktop/dev"
"&response_type=code" "&response_type=code"
"&client_id=%s" "&client_id=%s"
"&access_type=offline" "&access_type=offline"
"&approval_prompt=force", "&approval_prompt=force",
net::EscapeUrlEncodedData(kAppRemotingAuthScopeValues, use_plus).c_str(), net::EscapeUrlEncodedData(kAppRemotingAuthScopeValues, use_plus).c_str(),
net::EscapeUrlEncodedData(google_apis::GetOAuth2ClientID( net::EscapeUrlEncodedData(
google_apis::CLIENT_REMOTING), use_plus).c_str()); google_apis::GetOAuth2ClientID(google_apis::CLIENT_REMOTING),
use_plus).c_str());
} }
void PrintUsage() { void PrintUsage() {
...@@ -69,12 +70,14 @@ void PrintUsage() { ...@@ -69,12 +70,14 @@ void PrintUsage() {
switches::kHelpSwitchName); switches::kHelpSwitchName);
printf(" %s: Specifies the service api to use (dev|test) [default: dev]\n", printf(" %s: Specifies the service api to use (dev|test) [default: dev]\n",
switches::kServiceEnvironmentSwitchName); switches::kServiceEnvironmentSwitchName);
printf(" %s: Retrieves and displays the connection status for all known " printf(
"hosts, no tests will be run\n", " %s: Retrieves and displays the connection status for all known "
switches::kShowHostAvailabilitySwitchName); "hosts, no tests will be run\n",
printf(" %s: Specifies the optional logging level of the tool (0-3)." switches::kShowHostAvailabilitySwitchName);
" [default: off]\n", printf(
switches::kLoggingLevelSwitchName); " %s: Specifies the optional logging level of the tool (0-3)."
" [default: off]\n",
switches::kLoggingLevelSwitchName);
} }
void PrintAuthCodeInfo() { void PrintAuthCodeInfo() {
...@@ -93,18 +96,20 @@ void PrintAuthCodeInfo() { ...@@ -93,18 +96,20 @@ void PrintAuthCodeInfo() {
printf("\n has been revoked or expired.\n"); printf("\n has been revoked or expired.\n");
printf(" Passing in the same auth code twice will result in an error\n"); printf(" Passing in the same auth code twice will result in an error\n");
printf("\nFollow these steps to produce an auth code:\n" printf(
" - Open the Authorization URL link shown below in your browser\n" "\nFollow these steps to produce an auth code:\n"
" - Approve the requested permissions for the tool\n" " - Open the Authorization URL link shown below in your browser\n"
" - Copy the 'code' value in the redirected URL\n" " - Approve the requested permissions for the tool\n"
" - Run the tool and pass in copied auth code as a parameter\n"); " - Copy the 'code' value in the redirected URL\n"
" - Run the tool and pass in copied auth code as a parameter\n");
printf("\nAuthorization URL:\n"); printf("\nAuthorization URL:\n");
printf("%s\n", GetAuthorizationCodeUri().c_str()); printf("%s\n", GetAuthorizationCodeUri().c_str());
printf("\nRedirected URL Example:\n"); printf("\nRedirected URL Example:\n");
printf("https://chromoting-oauth.talkgadget.google.com/talkgadget/oauth/" printf(
"chrome-remote-desktop/dev?code=4/AKtf...\n"); "https://chromoting-oauth.talkgadget.google.com/talkgadget/oauth/"
"chrome-remote-desktop/dev?code=4/AKtf...\n");
printf("\nTool usage example with the newly created auth code:\n"); printf("\nTool usage example with the newly created auth code:\n");
printf("ar_test_driver --%s=example@gmail.com --%s=4/AKtf...\n\n", printf("ar_test_driver --%s=example@gmail.com --%s=4/AKtf...\n\n",
......
...@@ -142,8 +142,8 @@ void AppRemotingTestDriverEnvironment::ShowHostAvailability() { ...@@ -142,8 +142,8 @@ void AppRemotingTestDriverEnvironment::ShowHostAvailability() {
while (it != application_names_.end()) { while (it != application_names_.end()) {
std::string application_name = *it; std::string application_name = *it;
const RemoteApplicationDetails& application_details = GetDetailsFromAppName( const RemoteApplicationDetails& application_details =
application_name); GetDetailsFromAppName(application_name);
RemoteHostInfo remote_host_info; RemoteHostInfo remote_host_info;
GetRemoteHostInfoForApplicationId(application_details.application_id, GetRemoteHostInfoForApplicationId(application_details.application_id,
......
...@@ -26,15 +26,13 @@ using testing::_; ...@@ -26,15 +26,13 @@ using testing::_;
// file system dependencies when testing the TestDriverEnvironment. // file system dependencies when testing the TestDriverEnvironment.
class FakeRefreshTokenStore : public RefreshTokenStore { class FakeRefreshTokenStore : public RefreshTokenStore {
public: public:
FakeRefreshTokenStore() : FakeRefreshTokenStore()
refresh_token_value(kRefreshTokenValue), : refresh_token_value(kRefreshTokenValue),
refresh_token_write_succeeded(true), refresh_token_write_succeeded(true),
refresh_token_write_attempted(false) {} refresh_token_write_attempted(false) {}
~FakeRefreshTokenStore() override {} ~FakeRefreshTokenStore() override {}
std::string FetchRefreshToken() override { std::string FetchRefreshToken() override { return refresh_token_value; };
return refresh_token_value;
};
bool StoreRefreshToken(const std::string& refresh_token) override { bool StoreRefreshToken(const std::string& refresh_token) override {
// Record the information passed to us to write. // Record the information passed to us to write.
...@@ -70,9 +68,8 @@ TEST(AppRemotingTestDriverEnvironmentTest, InitializeObjectWithAuthCode) { ...@@ -70,9 +68,8 @@ TEST(AppRemotingTestDriverEnvironmentTest, InitializeObjectWithAuthCode) {
EXPECT_CALL(mock_access_token_fetcher, GetAccessTokenFromRefreshToken(_, _)) EXPECT_CALL(mock_access_token_fetcher, GetAccessTokenFromRefreshToken(_, _))
.Times(0); .Times(0);
AppRemotingTestDriverEnvironment environment_object( AppRemotingTestDriverEnvironment environment_object(kUserNameValue,
kUserNameValue, kDeveloperEnvironment);
kDeveloperEnvironment);
environment_object.SetAccessTokenFetcherForTest(&mock_access_token_fetcher); environment_object.SetAccessTokenFetcherForTest(&mock_access_token_fetcher);
...@@ -83,10 +80,12 @@ TEST(AppRemotingTestDriverEnvironmentTest, InitializeObjectWithAuthCode) { ...@@ -83,10 +80,12 @@ TEST(AppRemotingTestDriverEnvironmentTest, InitializeObjectWithAuthCode) {
EXPECT_TRUE(init_result); EXPECT_TRUE(init_result);
EXPECT_TRUE(fake_token_store.refresh_token_write_attempted); EXPECT_TRUE(fake_token_store.refresh_token_write_attempted);
EXPECT_EQ(fake_token_store.refresh_token_value_written.compare( EXPECT_EQ(fake_token_store.refresh_token_value_written.compare(
kFakeAccessTokenFetcherRefreshTokenValue), 0); kFakeAccessTokenFetcherRefreshTokenValue),
0);
EXPECT_EQ(environment_object.user_name().compare(kUserNameValue), 0); EXPECT_EQ(environment_object.user_name().compare(kUserNameValue), 0);
EXPECT_EQ(environment_object.access_token().compare( EXPECT_EQ(environment_object.access_token().compare(
kFakeAccessTokenFetcherAccessTokenValue), 0); kFakeAccessTokenFetcherAccessTokenValue),
0);
// Attempt to init again, we should not see any additional calls or errors. // Attempt to init again, we should not see any additional calls or errors.
init_result = environment_object.Initialize(kAuthCodeValue); init_result = environment_object.Initialize(kAuthCodeValue);
...@@ -112,9 +111,8 @@ TEST(AppRemotingTestDriverEnvironmentTest, InitializeObjectWithAuthCodeFailed) { ...@@ -112,9 +111,8 @@ TEST(AppRemotingTestDriverEnvironmentTest, InitializeObjectWithAuthCodeFailed) {
EXPECT_CALL(mock_access_token_fetcher, GetAccessTokenFromRefreshToken(_, _)) EXPECT_CALL(mock_access_token_fetcher, GetAccessTokenFromRefreshToken(_, _))
.Times(0); .Times(0);
AppRemotingTestDriverEnvironment environment_object( AppRemotingTestDriverEnvironment environment_object(kUserNameValue,
kUserNameValue, kDeveloperEnvironment);
kDeveloperEnvironment);
environment_object.SetAccessTokenFetcherForTest(&mock_access_token_fetcher); environment_object.SetAccessTokenFetcherForTest(&mock_access_token_fetcher);
...@@ -140,9 +138,8 @@ TEST(AppRemotingTestDriverEnvironmentTest, InitializeObjectWithRefreshToken) { ...@@ -140,9 +138,8 @@ TEST(AppRemotingTestDriverEnvironmentTest, InitializeObjectWithRefreshToken) {
EXPECT_CALL(mock_access_token_fetcher, GetAccessTokenFromAuthCode(_, _)) EXPECT_CALL(mock_access_token_fetcher, GetAccessTokenFromAuthCode(_, _))
.Times(0); .Times(0);
AppRemotingTestDriverEnvironment environment_object( AppRemotingTestDriverEnvironment environment_object(kUserNameValue,
kUserNameValue, kDeveloperEnvironment);
kDeveloperEnvironment);
environment_object.SetAccessTokenFetcherForTest(&mock_access_token_fetcher); environment_object.SetAccessTokenFetcherForTest(&mock_access_token_fetcher);
...@@ -160,7 +157,8 @@ TEST(AppRemotingTestDriverEnvironmentTest, InitializeObjectWithRefreshToken) { ...@@ -160,7 +157,8 @@ TEST(AppRemotingTestDriverEnvironmentTest, InitializeObjectWithRefreshToken) {
// Verify the object was initialized correctly. // Verify the object was initialized correctly.
EXPECT_EQ(environment_object.user_name().compare(kUserNameValue), 0); EXPECT_EQ(environment_object.user_name().compare(kUserNameValue), 0);
EXPECT_EQ(environment_object.access_token().compare( EXPECT_EQ(environment_object.access_token().compare(
kFakeAccessTokenFetcherAccessTokenValue), 0); kFakeAccessTokenFetcherAccessTokenValue),
0);
// Attempt to init again, we should not see any additional calls or errors. // Attempt to init again, we should not see any additional calls or errors.
init_result = environment_object.Initialize(std::string()); init_result = environment_object.Initialize(std::string());
...@@ -187,9 +185,8 @@ TEST(AppRemotingTestDriverEnvironmentTest, ...@@ -187,9 +185,8 @@ TEST(AppRemotingTestDriverEnvironmentTest,
EXPECT_CALL(mock_access_token_fetcher, GetAccessTokenFromAuthCode(_, _)) EXPECT_CALL(mock_access_token_fetcher, GetAccessTokenFromAuthCode(_, _))
.Times(0); .Times(0);
AppRemotingTestDriverEnvironment environment_object( AppRemotingTestDriverEnvironment environment_object(kUserNameValue,
kUserNameValue, kDeveloperEnvironment);
kDeveloperEnvironment);
environment_object.SetAccessTokenFetcherForTest(&mock_access_token_fetcher); environment_object.SetAccessTokenFetcherForTest(&mock_access_token_fetcher);
...@@ -218,9 +215,8 @@ TEST(AppRemotingTestDriverEnvironmentTest, ...@@ -218,9 +215,8 @@ TEST(AppRemotingTestDriverEnvironmentTest,
EXPECT_CALL(mock_access_token_fetcher, GetAccessTokenFromRefreshToken(_, _)) EXPECT_CALL(mock_access_token_fetcher, GetAccessTokenFromRefreshToken(_, _))
.Times(0); .Times(0);
AppRemotingTestDriverEnvironment environment_object( AppRemotingTestDriverEnvironment environment_object(kUserNameValue,
kUserNameValue, kDeveloperEnvironment);
kDeveloperEnvironment);
environment_object.SetAccessTokenFetcherForTest(&mock_access_token_fetcher); environment_object.SetAccessTokenFetcherForTest(&mock_access_token_fetcher);
...@@ -252,9 +248,8 @@ TEST(AppRemotingTestDriverEnvironmentTest, ...@@ -252,9 +248,8 @@ TEST(AppRemotingTestDriverEnvironmentTest,
EXPECT_CALL(mock_access_token_fetcher, GetAccessTokenFromRefreshToken(_, _)) EXPECT_CALL(mock_access_token_fetcher, GetAccessTokenFromRefreshToken(_, _))
.Times(0); .Times(0);
AppRemotingTestDriverEnvironment environment_object( AppRemotingTestDriverEnvironment environment_object(kUserNameValue,
kUserNameValue, kDeveloperEnvironment);
kDeveloperEnvironment);
environment_object.SetAccessTokenFetcherForTest(&mock_access_token_fetcher); environment_object.SetAccessTokenFetcherForTest(&mock_access_token_fetcher);
...@@ -284,13 +279,12 @@ TEST(AppRemotingTestDriverEnvironmentTest, ...@@ -284,13 +279,12 @@ TEST(AppRemotingTestDriverEnvironmentTest,
EXPECT_CALL(mock_access_token_fetcher, GetAccessTokenFromAuthCode(_, _)) EXPECT_CALL(mock_access_token_fetcher, GetAccessTokenFromAuthCode(_, _))
.Times(1); .Times(1);
EXPECT_CALL(mock_access_token_fetcher, EXPECT_CALL(mock_access_token_fetcher, GetAccessTokenFromRefreshToken(_, _))
GetAccessTokenFromRefreshToken(_, _)).Times(1); .Times(1);
} }
AppRemotingTestDriverEnvironment environment_object( AppRemotingTestDriverEnvironment environment_object(kUserNameValue,
kUserNameValue, kDeveloperEnvironment);
kDeveloperEnvironment);
environment_object.SetAccessTokenFetcherForTest(&mock_access_token_fetcher); environment_object.SetAccessTokenFetcherForTest(&mock_access_token_fetcher);
...@@ -301,10 +295,12 @@ TEST(AppRemotingTestDriverEnvironmentTest, ...@@ -301,10 +295,12 @@ TEST(AppRemotingTestDriverEnvironmentTest,
EXPECT_TRUE(init_result); EXPECT_TRUE(init_result);
EXPECT_TRUE(fake_token_store.refresh_token_write_attempted); EXPECT_TRUE(fake_token_store.refresh_token_write_attempted);
EXPECT_EQ(fake_token_store.refresh_token_value_written.compare( EXPECT_EQ(fake_token_store.refresh_token_value_written.compare(
kFakeAccessTokenFetcherRefreshTokenValue), 0); kFakeAccessTokenFetcherRefreshTokenValue),
0);
EXPECT_EQ(environment_object.user_name().compare(kUserNameValue), 0); EXPECT_EQ(environment_object.user_name().compare(kUserNameValue), 0);
EXPECT_EQ(environment_object.access_token().compare( EXPECT_EQ(environment_object.access_token().compare(
kFakeAccessTokenFetcherAccessTokenValue), 0); kFakeAccessTokenFetcherAccessTokenValue),
0);
// Attempt to init again, we should not see any additional calls or errors. // Attempt to init again, we should not see any additional calls or errors.
bool refresh_result = environment_object.RefreshAccessToken(); bool refresh_result = environment_object.RefreshAccessToken();
...@@ -331,13 +327,12 @@ TEST(AppRemotingTestDriverEnvironmentTest, RefreshAccessTokenFailure) { ...@@ -331,13 +327,12 @@ TEST(AppRemotingTestDriverEnvironmentTest, RefreshAccessTokenFailure) {
.Times(1); .Times(1);
// Mock is set up for this call to fail. // Mock is set up for this call to fail.
EXPECT_CALL(mock_access_token_fetcher, EXPECT_CALL(mock_access_token_fetcher, GetAccessTokenFromRefreshToken(_, _))
GetAccessTokenFromRefreshToken(_, _)).Times(1); .Times(1);
} }
AppRemotingTestDriverEnvironment environment_object( AppRemotingTestDriverEnvironment environment_object(kUserNameValue,
kUserNameValue, kDeveloperEnvironment);
kDeveloperEnvironment);
environment_object.SetAccessTokenFetcherForTest(&mock_access_token_fetcher); environment_object.SetAccessTokenFetcherForTest(&mock_access_token_fetcher);
...@@ -348,10 +343,12 @@ TEST(AppRemotingTestDriverEnvironmentTest, RefreshAccessTokenFailure) { ...@@ -348,10 +343,12 @@ TEST(AppRemotingTestDriverEnvironmentTest, RefreshAccessTokenFailure) {
EXPECT_TRUE(init_result); EXPECT_TRUE(init_result);
EXPECT_TRUE(fake_token_store.refresh_token_write_attempted); EXPECT_TRUE(fake_token_store.refresh_token_write_attempted);
EXPECT_EQ(fake_token_store.refresh_token_value_written.compare( EXPECT_EQ(fake_token_store.refresh_token_value_written.compare(
kFakeAccessTokenFetcherRefreshTokenValue), 0); kFakeAccessTokenFetcherRefreshTokenValue),
0);
EXPECT_EQ(environment_object.user_name().compare(kUserNameValue), 0); EXPECT_EQ(environment_object.user_name().compare(kUserNameValue), 0);
EXPECT_EQ(environment_object.access_token().compare( EXPECT_EQ(environment_object.access_token().compare(
kFakeAccessTokenFetcherAccessTokenValue), 0); kFakeAccessTokenFetcherAccessTokenValue),
0);
fake_access_token_fetcher->set_fail_access_token_from_refresh_token(true); fake_access_token_fetcher->set_fail_access_token_from_refresh_token(true);
......
...@@ -7,12 +7,13 @@ ...@@ -7,12 +7,13 @@
namespace remoting { namespace remoting {
namespace test { namespace test {
FakeAccessTokenFetcher::FakeAccessTokenFetcher() : FakeAccessTokenFetcher::FakeAccessTokenFetcher()
fail_access_token_from_auth_code_(false), : fail_access_token_from_auth_code_(false),
fail_access_token_from_refresh_token_(false) {} fail_access_token_from_refresh_token_(false) {
}
FakeAccessTokenFetcher::~FakeAccessTokenFetcher() {}
FakeAccessTokenFetcher::~FakeAccessTokenFetcher() {
}
void FakeAccessTokenFetcher::GetAccessTokenFromAuthCode( void FakeAccessTokenFetcher::GetAccessTokenFromAuthCode(
const std::string& auth_code, const std::string& auth_code,
......
...@@ -24,9 +24,8 @@ class FakeAccessTokenFetcher : public AccessTokenFetcher { ...@@ -24,9 +24,8 @@ class FakeAccessTokenFetcher : public AccessTokenFetcher {
~FakeAccessTokenFetcher() override; ~FakeAccessTokenFetcher() override;
// AccessTokenFetcher interface. // AccessTokenFetcher interface.
void GetAccessTokenFromAuthCode( void GetAccessTokenFromAuthCode(const std::string& auth_code,
const std::string& auth_code, const AccessTokenCallback& callback) override;
const AccessTokenCallback& callback) override;
void GetAccessTokenFromRefreshToken( void GetAccessTokenFromRefreshToken(
const std::string& refresh_token, const std::string& refresh_token,
const AccessTokenCallback& callback) override; const AccessTokenCallback& callback) override;
......
...@@ -7,10 +7,12 @@ ...@@ -7,10 +7,12 @@
namespace remoting { namespace remoting {
namespace test { namespace test {
FakeRemoteHostInfoFetcher::FakeRemoteHostInfoFetcher() : FakeRemoteHostInfoFetcher::FakeRemoteHostInfoFetcher()
fail_retrieve_remote_host_info_(false) {} : fail_retrieve_remote_host_info_(false) {
}
FakeRemoteHostInfoFetcher::~FakeRemoteHostInfoFetcher() {} FakeRemoteHostInfoFetcher::~FakeRemoteHostInfoFetcher() {
}
bool FakeRemoteHostInfoFetcher::RetrieveRemoteHostInfo( bool FakeRemoteHostInfoFetcher::RetrieveRemoteHostInfo(
const std::string& application_id, const std::string& application_id,
......
...@@ -21,11 +21,10 @@ class FakeRemoteHostInfoFetcher : public RemoteHostInfoFetcher { ...@@ -21,11 +21,10 @@ class FakeRemoteHostInfoFetcher : public RemoteHostInfoFetcher {
~FakeRemoteHostInfoFetcher() override; ~FakeRemoteHostInfoFetcher() override;
// RemoteHostInfoFetcher interface. // RemoteHostInfoFetcher interface.
bool RetrieveRemoteHostInfo( bool RetrieveRemoteHostInfo(const std::string& application_id,
const std::string& application_id, const std::string& access_token,
const std::string& access_token, ServiceEnvironment service_environment,
ServiceEnvironment service_environment, const RemoteHostInfoCallback& callback) override;
const RemoteHostInfoCallback& callback) override;
void set_fail_retrieve_remote_host_info(bool fail) { void set_fail_retrieve_remote_host_info(bool fail) {
fail_retrieve_remote_host_info_ = fail; fail_retrieve_remote_host_info_ = fail;
......
...@@ -20,12 +20,13 @@ void MockAccessTokenFetcher::SetAccessTokenFetcher( ...@@ -20,12 +20,13 @@ void MockAccessTokenFetcher::SetAccessTokenFetcher(
scoped_ptr<AccessTokenFetcher> fetcher) { scoped_ptr<AccessTokenFetcher> fetcher) {
internal_access_token_fetcher_ = fetcher.Pass(); internal_access_token_fetcher_ = fetcher.Pass();
ON_CALL(*this, GetAccessTokenFromAuthCode(_, _)).WillByDefault( ON_CALL(*this, GetAccessTokenFromAuthCode(_, _))
Invoke(internal_access_token_fetcher_.get(), .WillByDefault(Invoke(internal_access_token_fetcher_.get(),
&AccessTokenFetcher::GetAccessTokenFromAuthCode)); &AccessTokenFetcher::GetAccessTokenFromAuthCode));
ON_CALL(*this, GetAccessTokenFromRefreshToken(_, _)).WillByDefault( ON_CALL(*this, GetAccessTokenFromRefreshToken(_, _))
Invoke(internal_access_token_fetcher_.get(), .WillByDefault(
&AccessTokenFetcher::GetAccessTokenFromRefreshToken)); Invoke(internal_access_token_fetcher_.get(),
&AccessTokenFetcher::GetAccessTokenFromRefreshToken));
} }
} // namespace test } // namespace test
......
...@@ -24,8 +24,8 @@ base::FilePath GetRefreshTokenDirPath(const std::string& user_name) { ...@@ -24,8 +24,8 @@ base::FilePath GetRefreshTokenDirPath(const std::string& user_name) {
} }
refresh_token_dir_path = refresh_token_dir_path.Append(kRemotingFolder); refresh_token_dir_path = refresh_token_dir_path.Append(kRemotingFolder);
refresh_token_dir_path = refresh_token_dir_path.Append( refresh_token_dir_path =
kRefreshTokenStoreFolder); refresh_token_dir_path.Append(kRefreshTokenStoreFolder);
// We call AppendASCII here our user_name is a std::string but wide strings // We call AppendASCII here our user_name is a std::string but wide strings
// are used on WIN platforms. ApendASCII will convert our std::string into // are used on WIN platforms. ApendASCII will convert our std::string into
...@@ -58,10 +58,12 @@ class RefreshTokenStoreOnDisk : public RefreshTokenStore { ...@@ -58,10 +58,12 @@ class RefreshTokenStoreOnDisk : public RefreshTokenStore {
DISALLOW_COPY_AND_ASSIGN(RefreshTokenStoreOnDisk); DISALLOW_COPY_AND_ASSIGN(RefreshTokenStoreOnDisk);
}; };
RefreshTokenStoreOnDisk::RefreshTokenStoreOnDisk(const std::string user_name) : RefreshTokenStoreOnDisk::RefreshTokenStoreOnDisk(const std::string user_name)
user_name_(user_name) {} : user_name_(user_name) {
}
RefreshTokenStoreOnDisk::~RefreshTokenStoreOnDisk() {} RefreshTokenStoreOnDisk::~RefreshTokenStoreOnDisk() {
}
std::string RefreshTokenStoreOnDisk::FetchRefreshToken() { std::string RefreshTokenStoreOnDisk::FetchRefreshToken() {
base::FilePath token_dir_path(GetRefreshTokenDirPath(user_name_)); base::FilePath token_dir_path(GetRefreshTokenDirPath(user_name_));
...@@ -131,8 +133,8 @@ bool RefreshTokenStoreOnDisk::StoreRefreshToken( ...@@ -131,8 +133,8 @@ bool RefreshTokenStoreOnDisk::StoreRefreshToken(
scoped_ptr<RefreshTokenStore> RefreshTokenStore::OnDisk( scoped_ptr<RefreshTokenStore> RefreshTokenStore::OnDisk(
const std::string& user_name) { const std::string& user_name) {
return make_scoped_ptr<RefreshTokenStore>(new RefreshTokenStoreOnDisk( return make_scoped_ptr<RefreshTokenStore>(
user_name)); new RefreshTokenStoreOnDisk(user_name));
} }
} // namespace test } // namespace test
......
...@@ -9,10 +9,12 @@ ...@@ -9,10 +9,12 @@
namespace remoting { namespace remoting {
namespace test { namespace test {
RemoteHostInfo::RemoteHostInfo() : RemoteHostInfo::RemoteHostInfo()
remote_host_status(kRemoteHostStatusUnknown) {} : remote_host_status(kRemoteHostStatusUnknown) {
}
RemoteHostInfo::~RemoteHostInfo() {} RemoteHostInfo::~RemoteHostInfo() {
}
bool RemoteHostInfo::IsReadyForConnection() const { bool RemoteHostInfo::IsReadyForConnection() const {
return (remote_host_status == kRemoteHostStatusReady); return (remote_host_status == kRemoteHostStatusReady);
......
...@@ -11,9 +11,9 @@ namespace remoting { ...@@ -11,9 +11,9 @@ namespace remoting {
namespace test { namespace test {
enum RemoteHostStatus { enum RemoteHostStatus {
kRemoteHostStatusReady, kRemoteHostStatusReady,
kRemoteHostStatusPending, kRemoteHostStatusPending,
kRemoteHostStatusUnknown kRemoteHostStatusUnknown
}; };
// Holds the information needed to establish a connection with a remote host. // Holds the information needed to establish a connection with a remote host.
......
...@@ -43,25 +43,23 @@ namespace test { ...@@ -43,25 +43,23 @@ namespace test {
// necessary, for use by the RemoteHostInfoFetcher. // necessary, for use by the RemoteHostInfoFetcher.
class RemoteHostInfoFetcherTest : public ::testing::Test { class RemoteHostInfoFetcherTest : public ::testing::Test {
public: public:
RemoteHostInfoFetcherTest() : RemoteHostInfoFetcherTest() : url_fetcher_factory_(nullptr) {}
url_fetcher_factory_(nullptr) {}
~RemoteHostInfoFetcherTest() override {} ~RemoteHostInfoFetcherTest() override {}
// Used as a RemoteHostInfoCallback for testing. // Used as a RemoteHostInfoCallback for testing.
void OnRemoteHostInfoRetrieved( void OnRemoteHostInfoRetrieved(
base::Closure done_closure, base::Closure done_closure,
const RemoteHostInfo& retrieved_remote_host_info); const RemoteHostInfo& retrieved_remote_host_info);
protected: protected:
// testing::Test interface. // testing::Test interface.
void SetUp() override; void SetUp() override;
// Sets the HTTP status and data returned for a specified URL. // Sets the HTTP status and data returned for a specified URL.
void SetFakeResponse( void SetFakeResponse(const GURL& url,
const GURL& url, const std::string& data,
const std::string& data, net::HttpStatusCode code,
net::HttpStatusCode code, net::URLRequestStatus::Status status);
net::URLRequestStatus::Status status);
// Used for result verification. // Used for result verification.
RemoteHostInfo remote_host_info_; RemoteHostInfo remote_host_info_;
...@@ -92,13 +90,11 @@ void RemoteHostInfoFetcherTest::SetUp() { ...@@ -92,13 +90,11 @@ void RemoteHostInfoFetcherTest::SetUp() {
message_loop_.reset(new base::MessageLoopForIO); message_loop_.reset(new base::MessageLoopForIO);
} }
dev_service_environment_url_ = base::StringPrintf( dev_service_environment_url_ =
kDevServiceEnvironmentUrlFormat, base::StringPrintf(kDevServiceEnvironmentUrlFormat, kTestApplicationId);
kTestApplicationId);
test_service_environment_url_ = base::StringPrintf( test_service_environment_url_ =
kTestServiceEnvironmentUrlFormat, base::StringPrintf(kTestServiceEnvironmentUrlFormat, kTestApplicationId);
kTestApplicationId);
} }
void RemoteHostInfoFetcherTest::SetFakeResponse( void RemoteHostInfoFetcherTest::SetFakeResponse(
...@@ -110,29 +106,22 @@ void RemoteHostInfoFetcherTest::SetFakeResponse( ...@@ -110,29 +106,22 @@ void RemoteHostInfoFetcherTest::SetFakeResponse(
} }
TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoFromDev) { TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoFromDev) {
SetFakeResponse( SetFakeResponse(GURL(dev_service_environment_url_),
GURL(dev_service_environment_url_), kRemoteHostInfoReadyResponse, net::HTTP_OK,
kRemoteHostInfoReadyResponse, net::URLRequestStatus::SUCCESS);
net::HTTP_OK,
net::URLRequestStatus::SUCCESS); SetFakeResponse(GURL(test_service_environment_url_),
kRemoteHostInfoEmptyResponse, net::HTTP_NOT_FOUND,
SetFakeResponse( net::URLRequestStatus::FAILED);
GURL(test_service_environment_url_),
kRemoteHostInfoEmptyResponse,
net::HTTP_NOT_FOUND,
net::URLRequestStatus::FAILED);
base::RunLoop run_loop; base::RunLoop run_loop;
RemoteHostInfoCallback remote_host_info_callback = RemoteHostInfoCallback remote_host_info_callback =
base::Bind(&RemoteHostInfoFetcherTest::OnRemoteHostInfoRetrieved, base::Bind(&RemoteHostInfoFetcherTest::OnRemoteHostInfoRetrieved,
base::Unretained(this), base::Unretained(this), run_loop.QuitClosure());
run_loop.QuitClosure());
RemoteHostInfoFetcher remote_host_info_fetcher; RemoteHostInfoFetcher remote_host_info_fetcher;
bool request_started = remote_host_info_fetcher.RetrieveRemoteHostInfo( bool request_started = remote_host_info_fetcher.RetrieveRemoteHostInfo(
kTestApplicationId, kTestApplicationId, kAccessTokenValue, kDeveloperEnvironment,
kAccessTokenValue,
kDeveloperEnvironment,
remote_host_info_callback); remote_host_info_callback);
run_loop.Run(); run_loop.Run();
...@@ -147,29 +136,22 @@ TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoFromDev) { ...@@ -147,29 +136,22 @@ TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoFromDev) {
} }
TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoFromTest) { TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoFromTest) {
SetFakeResponse( SetFakeResponse(GURL(test_service_environment_url_),
GURL(test_service_environment_url_), kRemoteHostInfoReadyResponse, net::HTTP_OK,
kRemoteHostInfoReadyResponse, net::URLRequestStatus::SUCCESS);
net::HTTP_OK,
net::URLRequestStatus::SUCCESS); SetFakeResponse(GURL(dev_service_environment_url_),
kRemoteHostInfoEmptyResponse, net::HTTP_NOT_FOUND,
SetFakeResponse( net::URLRequestStatus::FAILED);
GURL(dev_service_environment_url_),
kRemoteHostInfoEmptyResponse,
net::HTTP_NOT_FOUND,
net::URLRequestStatus::FAILED);
base::RunLoop run_loop; base::RunLoop run_loop;
RemoteHostInfoCallback remote_host_info_callback = RemoteHostInfoCallback remote_host_info_callback =
base::Bind(&RemoteHostInfoFetcherTest::OnRemoteHostInfoRetrieved, base::Bind(&RemoteHostInfoFetcherTest::OnRemoteHostInfoRetrieved,
base::Unretained(this), base::Unretained(this), run_loop.QuitClosure());
run_loop.QuitClosure());
RemoteHostInfoFetcher remote_host_info_fetcher; RemoteHostInfoFetcher remote_host_info_fetcher;
bool request_started = remote_host_info_fetcher.RetrieveRemoteHostInfo( bool request_started = remote_host_info_fetcher.RetrieveRemoteHostInfo(
kTestApplicationId, kTestApplicationId, kAccessTokenValue, kTestingEnvironment,
kAccessTokenValue,
kTestingEnvironment,
remote_host_info_callback); remote_host_info_callback);
run_loop.Run(); run_loop.Run();
...@@ -187,37 +169,29 @@ TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoInvalidEnvironment) { ...@@ -187,37 +169,29 @@ TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoInvalidEnvironment) {
base::RunLoop run_loop; base::RunLoop run_loop;
RemoteHostInfoCallback remote_host_info_callback = RemoteHostInfoCallback remote_host_info_callback =
base::Bind(&RemoteHostInfoFetcherTest::OnRemoteHostInfoRetrieved, base::Bind(&RemoteHostInfoFetcherTest::OnRemoteHostInfoRetrieved,
base::Unretained(this), base::Unretained(this), run_loop.QuitClosure());
run_loop.QuitClosure());
RemoteHostInfoFetcher remote_host_info_fetcher; RemoteHostInfoFetcher remote_host_info_fetcher;
bool request_started = remote_host_info_fetcher.RetrieveRemoteHostInfo( bool request_started = remote_host_info_fetcher.RetrieveRemoteHostInfo(
kTestApplicationId, kTestApplicationId, kAccessTokenValue, kUnknownEnvironment,
kAccessTokenValue,
kUnknownEnvironment,
remote_host_info_callback); remote_host_info_callback);
EXPECT_FALSE(request_started); EXPECT_FALSE(request_started);
} }
TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoNetworkError) { TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoNetworkError) {
SetFakeResponse( SetFakeResponse(GURL(dev_service_environment_url_),
GURL(dev_service_environment_url_), kRemoteHostInfoReadyResponse, net::HTTP_NOT_FOUND,
kRemoteHostInfoReadyResponse, net::URLRequestStatus::FAILED);
net::HTTP_NOT_FOUND,
net::URLRequestStatus::FAILED);
base::RunLoop run_loop; base::RunLoop run_loop;
RemoteHostInfoCallback remote_host_info_callback = RemoteHostInfoCallback remote_host_info_callback =
base::Bind(&RemoteHostInfoFetcherTest::OnRemoteHostInfoRetrieved, base::Bind(&RemoteHostInfoFetcherTest::OnRemoteHostInfoRetrieved,
base::Unretained(this), base::Unretained(this), run_loop.QuitClosure());
run_loop.QuitClosure());
RemoteHostInfoFetcher remote_host_info_fetcher; RemoteHostInfoFetcher remote_host_info_fetcher;
bool request_started = remote_host_info_fetcher.RetrieveRemoteHostInfo( bool request_started = remote_host_info_fetcher.RetrieveRemoteHostInfo(
kTestApplicationId, kTestApplicationId, kAccessTokenValue, kDeveloperEnvironment,
kAccessTokenValue,
kDeveloperEnvironment,
remote_host_info_callback); remote_host_info_callback);
run_loop.Run(); run_loop.Run();
...@@ -235,23 +209,18 @@ TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoNetworkError) { ...@@ -235,23 +209,18 @@ TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoNetworkError) {
} }
TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoPendingResponse) { TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoPendingResponse) {
SetFakeResponse( SetFakeResponse(GURL(dev_service_environment_url_),
GURL(dev_service_environment_url_), kRemoteHostInfoPendingResponse, net::HTTP_OK,
kRemoteHostInfoPendingResponse, net::URLRequestStatus::SUCCESS);
net::HTTP_OK,
net::URLRequestStatus::SUCCESS);
base::RunLoop run_loop; base::RunLoop run_loop;
RemoteHostInfoCallback remote_host_info_callback = RemoteHostInfoCallback remote_host_info_callback =
base::Bind(&RemoteHostInfoFetcherTest::OnRemoteHostInfoRetrieved, base::Bind(&RemoteHostInfoFetcherTest::OnRemoteHostInfoRetrieved,
base::Unretained(this), base::Unretained(this), run_loop.QuitClosure());
run_loop.QuitClosure());
RemoteHostInfoFetcher remote_host_info_fetcher; RemoteHostInfoFetcher remote_host_info_fetcher;
bool request_started = remote_host_info_fetcher.RetrieveRemoteHostInfo( bool request_started = remote_host_info_fetcher.RetrieveRemoteHostInfo(
kTestApplicationId, kTestApplicationId, kAccessTokenValue, kDeveloperEnvironment,
kAccessTokenValue,
kDeveloperEnvironment,
remote_host_info_callback); remote_host_info_callback);
run_loop.Run(); run_loop.Run();
...@@ -269,23 +238,18 @@ TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoPendingResponse) { ...@@ -269,23 +238,18 @@ TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoPendingResponse) {
} }
TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoEmptyResponse) { TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoEmptyResponse) {
SetFakeResponse( SetFakeResponse(GURL(dev_service_environment_url_),
GURL(dev_service_environment_url_), kRemoteHostInfoEmptyResponse, net::HTTP_OK,
kRemoteHostInfoEmptyResponse, net::URLRequestStatus::SUCCESS);
net::HTTP_OK,
net::URLRequestStatus::SUCCESS);
base::RunLoop run_loop; base::RunLoop run_loop;
RemoteHostInfoCallback remote_host_info_callback = RemoteHostInfoCallback remote_host_info_callback =
base::Bind(&RemoteHostInfoFetcherTest::OnRemoteHostInfoRetrieved, base::Bind(&RemoteHostInfoFetcherTest::OnRemoteHostInfoRetrieved,
base::Unretained(this), base::Unretained(this), run_loop.QuitClosure());
run_loop.QuitClosure());
RemoteHostInfoFetcher remote_host_info_fetcher; RemoteHostInfoFetcher remote_host_info_fetcher;
bool request_started = remote_host_info_fetcher.RetrieveRemoteHostInfo( bool request_started = remote_host_info_fetcher.RetrieveRemoteHostInfo(
kTestApplicationId, kTestApplicationId, kAccessTokenValue, kDeveloperEnvironment,
kAccessTokenValue,
kDeveloperEnvironment,
remote_host_info_callback); remote_host_info_callback);
run_loop.Run(); run_loop.Run();
...@@ -304,29 +268,22 @@ TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoEmptyResponse) { ...@@ -304,29 +268,22 @@ TEST_F(RemoteHostInfoFetcherTest, RetrieveRemoteHostInfoEmptyResponse) {
TEST_F(RemoteHostInfoFetcherTest, MultipleRetrieveRemoteHostInfoRequests) { TEST_F(RemoteHostInfoFetcherTest, MultipleRetrieveRemoteHostInfoRequests) {
// First, we will fetch info from the development service environment. // First, we will fetch info from the development service environment.
SetFakeResponse( SetFakeResponse(GURL(dev_service_environment_url_),
GURL(dev_service_environment_url_), kRemoteHostInfoReadyResponse, net::HTTP_OK,
kRemoteHostInfoReadyResponse, net::URLRequestStatus::SUCCESS);
net::HTTP_OK,
net::URLRequestStatus::SUCCESS); SetFakeResponse(GURL(test_service_environment_url_),
kRemoteHostInfoEmptyResponse, net::HTTP_NOT_FOUND,
SetFakeResponse( net::URLRequestStatus::FAILED);
GURL(test_service_environment_url_),
kRemoteHostInfoEmptyResponse,
net::HTTP_NOT_FOUND,
net::URLRequestStatus::FAILED);
base::RunLoop dev_run_loop; base::RunLoop dev_run_loop;
RemoteHostInfoCallback dev_remote_host_info_callback = RemoteHostInfoCallback dev_remote_host_info_callback =
base::Bind(&RemoteHostInfoFetcherTest::OnRemoteHostInfoRetrieved, base::Bind(&RemoteHostInfoFetcherTest::OnRemoteHostInfoRetrieved,
base::Unretained(this), base::Unretained(this), dev_run_loop.QuitClosure());
dev_run_loop.QuitClosure());
RemoteHostInfoFetcher remote_host_info_fetcher; RemoteHostInfoFetcher remote_host_info_fetcher;
bool dev_request_started = remote_host_info_fetcher.RetrieveRemoteHostInfo( bool dev_request_started = remote_host_info_fetcher.RetrieveRemoteHostInfo(
kTestApplicationId, kTestApplicationId, kAccessTokenValue, kDeveloperEnvironment,
kAccessTokenValue,
kDeveloperEnvironment,
dev_remote_host_info_callback); dev_remote_host_info_callback);
dev_run_loop.Run(); dev_run_loop.Run();
...@@ -340,32 +297,25 @@ TEST_F(RemoteHostInfoFetcherTest, MultipleRetrieveRemoteHostInfoRequests) { ...@@ -340,32 +297,25 @@ TEST_F(RemoteHostInfoFetcherTest, MultipleRetrieveRemoteHostInfoRequests) {
EXPECT_TRUE(!remote_host_info_.shared_secret.empty()); EXPECT_TRUE(!remote_host_info_.shared_secret.empty());
// Next, we will fetch info from the test service environment. // Next, we will fetch info from the test service environment.
SetFakeResponse( SetFakeResponse(GURL(test_service_environment_url_),
GURL(test_service_environment_url_), kRemoteHostInfoReadyResponse, net::HTTP_OK,
kRemoteHostInfoReadyResponse, net::URLRequestStatus::SUCCESS);
net::HTTP_OK,
net::URLRequestStatus::SUCCESS); SetFakeResponse(GURL(dev_service_environment_url_),
kRemoteHostInfoEmptyResponse, net::HTTP_NOT_FOUND,
SetFakeResponse( net::URLRequestStatus::FAILED);
GURL(dev_service_environment_url_),
kRemoteHostInfoEmptyResponse,
net::HTTP_NOT_FOUND,
net::URLRequestStatus::FAILED);
base::RunLoop test_run_loop; base::RunLoop test_run_loop;
RemoteHostInfoCallback test_remote_host_info_callback = RemoteHostInfoCallback test_remote_host_info_callback =
base::Bind(&RemoteHostInfoFetcherTest::OnRemoteHostInfoRetrieved, base::Bind(&RemoteHostInfoFetcherTest::OnRemoteHostInfoRetrieved,
base::Unretained(this), base::Unretained(this), test_run_loop.QuitClosure());
test_run_loop.QuitClosure());
// Reset the state of our internal |remote_host_info_| object. // Reset the state of our internal |remote_host_info_| object.
remote_host_info_ = RemoteHostInfo(); remote_host_info_ = RemoteHostInfo();
EXPECT_FALSE(remote_host_info_.IsReadyForConnection()); EXPECT_FALSE(remote_host_info_.IsReadyForConnection());
bool test_request_started = remote_host_info_fetcher.RetrieveRemoteHostInfo( bool test_request_started = remote_host_info_fetcher.RetrieveRemoteHostInfo(
kTestApplicationId, kTestApplicationId, kAccessTokenValue, kTestingEnvironment,
kAccessTokenValue,
kTestingEnvironment,
test_remote_host_info_callback); test_remote_host_info_callback);
test_run_loop.Run(); test_run_loop.Run();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment