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

Side by Side Diff: chrome/common/net/gaia/oauth2_mint_token_fetcher_unittest.cc

Issue 10412050: Change most content::URLFetcher references to net::URLFetcher (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ChromeOS, address comments Created 8 years, 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 OAuth2MintTokenFetcher. 5 // A complete set of unit tests for OAuth2MintTokenFetcher.
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 class MockUrlFetcherFactory : public ScopedURLFetcherFactory, 50 class MockUrlFetcherFactory : public ScopedURLFetcherFactory,
51 public URLFetcherFactory { 51 public URLFetcherFactory {
52 public: 52 public:
53 MockUrlFetcherFactory() 53 MockUrlFetcherFactory()
54 : ScopedURLFetcherFactory(ALLOW_THIS_IN_INITIALIZER_LIST(this)) { 54 : ScopedURLFetcherFactory(ALLOW_THIS_IN_INITIALIZER_LIST(this)) {
55 } 55 }
56 virtual ~MockUrlFetcherFactory() {} 56 virtual ~MockUrlFetcherFactory() {}
57 57
58 MOCK_METHOD4( 58 MOCK_METHOD4(
59 CreateURLFetcher, 59 CreateURLFetcher,
60 content::URLFetcher* (int id, 60 URLFetcher* (int id,
61 const GURL& url, 61 const GURL& url,
62 URLFetcher::RequestType request_type, 62 URLFetcher::RequestType request_type,
63 URLFetcherDelegate* d)); 63 URLFetcherDelegate* d));
64 }; 64 };
65 65
66 class MockOAuth2MintTokenConsumer : public OAuth2MintTokenConsumer { 66 class MockOAuth2MintTokenConsumer : public OAuth2MintTokenConsumer {
67 public: 67 public:
68 MockOAuth2MintTokenConsumer() {} 68 MockOAuth2MintTokenConsumer() {}
69 ~MockOAuth2MintTokenConsumer() {} 69 ~MockOAuth2MintTokenConsumer() {}
70 70
71 MOCK_METHOD1(OnMintTokenSuccess, void(const std::string& access_token)); 71 MOCK_METHOD1(OnMintTokenSuccess, void(const std::string& access_token));
72 MOCK_METHOD1(OnMintTokenFailure, 72 MOCK_METHOD1(OnMintTokenFailure,
73 void(const GoogleServiceAuthError& error)); 73 void(const GoogleServiceAuthError& error));
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 { // Valid json: all good. 168 { // Valid json: all good.
169 TestURLFetcher url_fetcher(0, GURL("www.google.com"), NULL); 169 TestURLFetcher url_fetcher(0, GURL("www.google.com"), NULL);
170 url_fetcher.SetResponseString(kValidTokenResponse); 170 url_fetcher.SetResponseString(kValidTokenResponse);
171 171
172 std::string at; 172 std::string at;
173 EXPECT_TRUE(OAuth2MintTokenFetcher::ParseMintTokenResponse( 173 EXPECT_TRUE(OAuth2MintTokenFetcher::ParseMintTokenResponse(
174 &url_fetcher, &at)); 174 &url_fetcher, &at));
175 EXPECT_EQ("at1", at); 175 EXPECT_EQ("at1", at);
176 } 176 }
177 } 177 }
OLDNEW
« no previous file with comments | « chrome/common/net/gaia/oauth2_api_call_flow_unittest.cc ('k') | chrome/common/net/gaia/oauth2_mint_token_flow.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698