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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 years, 8 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
« no previous file with comments | « google_apis/gaia/oauth2_mint_token_flow.cc ('k') | google_apis/gaia/oauth_request_signer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 OAuth2MintTokenFlow. 5 // A complete set of unit tests for OAuth2MintTokenFlow.
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 EXPECT_TRUE(OAuth2MintTokenFlow::ParseIssueAdviceResponse( 265 EXPECT_TRUE(OAuth2MintTokenFlow::ParseIssueAdviceResponse(
266 json.get(), &ia)); 266 json.get(), &ia));
267 IssueAdviceInfo ia_expected(CreateIssueAdvice()); 267 IssueAdviceInfo ia_expected(CreateIssueAdvice());
268 EXPECT_EQ(ia_expected, ia); 268 EXPECT_EQ(ia_expected, ia);
269 } 269 }
270 } 270 }
271 271
272 TEST_F(OAuth2MintTokenFlowTest, ProcessApiCallSuccess) { 272 TEST_F(OAuth2MintTokenFlowTest, ProcessApiCallSuccess) {
273 { // No body. 273 { // No body.
274 TestURLFetcher url_fetcher(1, GURL("http://www.google.com"), NULL); 274 TestURLFetcher url_fetcher(1, GURL("http://www.google.com"), NULL);
275 url_fetcher.SetResponseString(""); 275 url_fetcher.SetResponseString(std::string());
276 CreateFlow(OAuth2MintTokenFlow::MODE_MINT_TOKEN_NO_FORCE); 276 CreateFlow(OAuth2MintTokenFlow::MODE_MINT_TOKEN_NO_FORCE);
277 EXPECT_CALL(delegate_, OnMintTokenFailure(_)); 277 EXPECT_CALL(delegate_, OnMintTokenFailure(_));
278 flow_->ProcessApiCallSuccess(&url_fetcher); 278 flow_->ProcessApiCallSuccess(&url_fetcher);
279 } 279 }
280 { // Bad json. 280 { // Bad json.
281 TestURLFetcher url_fetcher(1, GURL("http://www.google.com"), NULL); 281 TestURLFetcher url_fetcher(1, GURL("http://www.google.com"), NULL);
282 url_fetcher.SetResponseString("foo"); 282 url_fetcher.SetResponseString("foo");
283 CreateFlow(OAuth2MintTokenFlow::MODE_MINT_TOKEN_NO_FORCE); 283 CreateFlow(OAuth2MintTokenFlow::MODE_MINT_TOKEN_NO_FORCE);
284 EXPECT_CALL(delegate_, OnMintTokenFailure(_)); 284 EXPECT_CALL(delegate_, OnMintTokenFailure(_));
285 flow_->ProcessApiCallSuccess(&url_fetcher); 285 flow_->ProcessApiCallSuccess(&url_fetcher);
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 } 348 }
349 349
350 { // Non-null delegate. 350 { // Non-null delegate.
351 GoogleServiceAuthError error( 351 GoogleServiceAuthError error(
352 GoogleServiceAuthError::FromConnectionError(101)); 352 GoogleServiceAuthError::FromConnectionError(101));
353 CreateFlow(OAuth2MintTokenFlow::MODE_MINT_TOKEN_NO_FORCE); 353 CreateFlow(OAuth2MintTokenFlow::MODE_MINT_TOKEN_NO_FORCE);
354 EXPECT_CALL(delegate_, OnMintTokenFailure(error)); 354 EXPECT_CALL(delegate_, OnMintTokenFailure(error));
355 flow_->ProcessMintAccessTokenFailure(error); 355 flow_->ProcessMintAccessTokenFailure(error);
356 } 356 }
357 } 357 }
OLDNEW
« no previous file with comments | « google_apis/gaia/oauth2_mint_token_flow.cc ('k') | google_apis/gaia/oauth_request_signer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698