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

Side by Side Diff: google_apis/gaia/oauth2_access_token_fetcher_impl_unittest.cc

Issue 498123003: Remove implicit conversions from scoped_refptr to T* in google_apis/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // A complete set of unit tests for OAuth2AccessTokenFetcherImpl. 5 // A complete set of unit tests for OAuth2AccessTokenFetcherImpl.
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 MOCK_METHOD1(OnGetTokenFailure, void(const GoogleServiceAuthError& error)); 79 MOCK_METHOD1(OnGetTokenFailure, void(const GoogleServiceAuthError& error));
80 }; 80 };
81 81
82 } // namespace 82 } // namespace
83 83
84 class OAuth2AccessTokenFetcherImplTest : public testing::Test { 84 class OAuth2AccessTokenFetcherImplTest : public testing::Test {
85 public: 85 public:
86 OAuth2AccessTokenFetcherImplTest() 86 OAuth2AccessTokenFetcherImplTest()
87 : request_context_getter_(new net::TestURLRequestContextGetter( 87 : request_context_getter_(new net::TestURLRequestContextGetter(
88 base::MessageLoopProxy::current())), 88 base::MessageLoopProxy::current())),
89 fetcher_(&consumer_, request_context_getter_, "refresh_token") { 89 fetcher_(&consumer_, request_context_getter_.get(), "refresh_token") {
90 base::RunLoop().RunUntilIdle(); 90 base::RunLoop().RunUntilIdle();
91 } 91 }
92 92
93 virtual ~OAuth2AccessTokenFetcherImplTest() {} 93 virtual ~OAuth2AccessTokenFetcherImplTest() {}
94 94
95 virtual TestURLFetcher* SetupGetAccessToken(bool fetch_succeeds, 95 virtual TestURLFetcher* SetupGetAccessToken(bool fetch_succeeds,
96 int response_code, 96 int response_code,
97 const std::string& body) { 97 const std::string& body) {
98 GURL url(GaiaUrls::GetInstance()->oauth2_token_url()); 98 GURL url(GaiaUrls::GetInstance()->oauth2_token_url());
99 TestURLFetcher* url_fetcher = new TestURLFetcher(0, url, &fetcher_); 99 TestURLFetcher* url_fetcher = new TestURLFetcher(0, url, &fetcher_);
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 TestURLFetcher url_fetcher(0, GURL("www.google.com"), NULL); 256 TestURLFetcher url_fetcher(0, GURL("www.google.com"), NULL);
257 url_fetcher.SetResponseString(kValidFailureTokenResponse); 257 url_fetcher.SetResponseString(kValidFailureTokenResponse);
258 258
259 std::string error; 259 std::string error;
260 EXPECT_TRUE( 260 EXPECT_TRUE(
261 OAuth2AccessTokenFetcherImpl::ParseGetAccessTokenFailureResponse( 261 OAuth2AccessTokenFetcherImpl::ParseGetAccessTokenFailureResponse(
262 &url_fetcher, &error)); 262 &url_fetcher, &error));
263 EXPECT_EQ("invalid_grant", error); 263 EXPECT_EQ("invalid_grant", error);
264 } 264 }
265 } 265 }
OLDNEW
« no previous file with comments | « google_apis/gaia/merge_session_helper_unittest.cc ('k') | google_apis/gaia/oauth2_api_call_flow_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698