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

Unified Diff: remoting/host/gcd_state_updater_unittest.cc

Issue 1123163002: Updated remoting host to create instances of GCD-related classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@host-xmpp-connect2c
Patch Set: Moved ownership of GcdRestClient to GcdStateUpdater Created 5 years, 6 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/host/gcd_state_updater.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/gcd_state_updater_unittest.cc
diff --git a/remoting/host/gcd_state_updater_unittest.cc b/remoting/host/gcd_state_updater_unittest.cc
index 9d5baff659e5910fea688902bf7f19a9209cbb80..9ac287d50bdeaa20d1f63a86d180759395a13ba0 100644
--- a/remoting/host/gcd_state_updater_unittest.cc
+++ b/remoting/host/gcd_state_updater_unittest.cc
@@ -33,12 +33,13 @@ class GcdStateUpdaterTest : public testing::Test {
token_getter_(OAuthTokenGetter::SUCCESS,
"<fake_user_email>",
"<fake_access_token>"),
- rest_client_("http://gcd_base_url",
- "<gcd_device_id>",
- nullptr,
- &token_getter_),
+ rest_client_(new GcdRestClient(
+ "http://gcd_base_url",
+ "<gcd_device_id>",
+ nullptr,
+ &token_getter_)),
signal_strategy_("local_jid") {
- rest_client_.SetClockForTest(make_scoped_ptr(new base::SimpleTestClock));
+ rest_client_->SetClockForTest(make_scoped_ptr(new base::SimpleTestClock));
}
void OnSuccess() { on_success_count_++; }
@@ -51,7 +52,7 @@ class GcdStateUpdaterTest : public testing::Test {
scoped_ptr<base::Clock> clock_;
net::TestURLFetcherFactory url_fetcher_factory_;
FakeOAuthTokenGetter token_getter_;
- GcdRestClient rest_client_;
+ scoped_ptr<GcdRestClient> rest_client_;
FakeSignalStrategy signal_strategy_;
int on_success_count_ = 0;
int on_host_id_error_count_ = 0;
@@ -61,7 +62,7 @@ TEST_F(GcdStateUpdaterTest, Success) {
scoped_ptr<GcdStateUpdater> updater(new GcdStateUpdater(
base::Bind(&GcdStateUpdaterTest::OnSuccess, base::Unretained(this)),
base::Bind(&GcdStateUpdaterTest::OnHostIdError, base::Unretained(this)),
- &signal_strategy_, &rest_client_));
+ &signal_strategy_, rest_client_.Pass()));
signal_strategy_.Connect();
task_runner_->RunUntilIdle();
@@ -85,7 +86,7 @@ TEST_F(GcdStateUpdaterTest, QueuedRequests) {
scoped_ptr<GcdStateUpdater> updater(new GcdStateUpdater(
base::Bind(&GcdStateUpdaterTest::OnSuccess, base::Unretained(this)),
base::Bind(&GcdStateUpdaterTest::OnHostIdError, base::Unretained(this)),
- &signal_strategy_, &rest_client_));
+ &signal_strategy_, rest_client_.Pass()));
// Connect, then re-connect with a different JID while the status
// update for the first connection is pending.
@@ -129,7 +130,7 @@ TEST_F(GcdStateUpdaterTest, Retry) {
scoped_ptr<GcdStateUpdater> updater(new GcdStateUpdater(
base::Bind(&GcdStateUpdaterTest::OnSuccess, base::Unretained(this)),
base::Bind(&GcdStateUpdaterTest::OnHostIdError, base::Unretained(this)),
- &signal_strategy_, &rest_client_));
+ &signal_strategy_, rest_client_.Pass()));
signal_strategy_.Connect();
task_runner_->RunUntilIdle();
@@ -154,7 +155,7 @@ TEST_F(GcdStateUpdaterTest, UnknownHost) {
scoped_ptr<GcdStateUpdater> updater(new GcdStateUpdater(
base::Bind(&GcdStateUpdaterTest::OnSuccess, base::Unretained(this)),
base::Bind(&GcdStateUpdaterTest::OnHostIdError, base::Unretained(this)),
- &signal_strategy_, &rest_client_));
+ &signal_strategy_, rest_client_.Pass()));
signal_strategy_.Connect();
task_runner_->RunUntilIdle();
« no previous file with comments | « remoting/host/gcd_state_updater.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698