Index: remoting/test/access_token_fetcher_unittest.cc |
diff --git a/remoting/test/access_token_fetcher_unittest.cc b/remoting/test/access_token_fetcher_unittest.cc |
index b06151209ed7894b435dc2760010b23a0e1bdf24..bfbb4d6b6ff6b3914a771e865cd9a53f4080f01b 100644 |
--- a/remoting/test/access_token_fetcher_unittest.cc |
+++ b/remoting/test/access_token_fetcher_unittest.cc |
@@ -56,36 +56,23 @@ namespace test { |
// necessary, for use by the AccessTokenFetcher. |
class AccessTokenFetcherTest : public ::testing::Test { |
public: |
- AccessTokenFetcherTest() : |
- url_fetcher_factory_(nullptr) {} |
- ~AccessTokenFetcherTest() override {} |
+ AccessTokenFetcherTest(); |
+ ~AccessTokenFetcherTest() override; |
void OnAccessTokenRetrieved( |
base::Closure done_closure, |
const std::string& access_token, |
- const std::string& refresh_token) { |
- access_token_retrieved_ = access_token; |
- refresh_token_retrieved_ = refresh_token; |
- |
- done_closure.Run(); |
- } |
+ const std::string& refresh_token); |
protected: |
// Test interface. |
- void SetUp() override { |
- if (!base::MessageLoop::current()) { |
- // Create a temporary message loop if the current thread does not already |
- // have one so we can use its task runner to create a request object. |
- message_loop_.reset(new base::MessageLoopForIO); |
- } |
- } |
+ void SetUp() override; |
- void SetFakeResponse(const GURL& url, |
- const std::string& data, |
- net::HttpStatusCode code, |
- net::URLRequestStatus::Status status) { |
- url_fetcher_factory_.SetFakeResponse(url, data, code, status); |
- } |
+ void SetFakeResponse( |
+ const GURL& url, |
+ const std::string& data, |
+ net::HttpStatusCode code, |
+ net::URLRequestStatus::Status status); |
// Used for result verification |
std::string access_token_retrieved_; |
@@ -98,6 +85,37 @@ class AccessTokenFetcherTest : public ::testing::Test { |
DISALLOW_COPY_AND_ASSIGN(AccessTokenFetcherTest); |
}; |
+AccessTokenFetcherTest::AccessTokenFetcherTest() : |
+ url_fetcher_factory_(nullptr) {} |
+ |
+AccessTokenFetcherTest::~AccessTokenFetcherTest() {} |
+ |
+void AccessTokenFetcherTest::OnAccessTokenRetrieved( |
+ base::Closure done_closure, |
+ const std::string& access_token, |
+ const std::string& refresh_token) { |
+ access_token_retrieved_ = access_token; |
+ refresh_token_retrieved_ = refresh_token; |
+ |
+ done_closure.Run(); |
+} |
+ |
+void AccessTokenFetcherTest::SetUp() { |
+ if (!base::MessageLoop::current()) { |
+ // Create a temporary message loop if the current thread does not already |
+ // have one so we can use its task runner to create a request object. |
+ message_loop_.reset(new base::MessageLoopForIO); |
+ } |
+} |
+ |
+void AccessTokenFetcherTest::SetFakeResponse( |
+ const GURL& url, |
+ const std::string& data, |
+ net::HttpStatusCode code, |
+ net::URLRequestStatus::Status status) { |
+ url_fetcher_factory_.SetFakeResponse(url, data, code, status); |
+} |
+ |
TEST_F(AccessTokenFetcherTest, ExchangeAuthCodeForAccessToken) { |
SetFakeResponse( |
GaiaUrls::GetInstance()->oauth2_token_url(), |