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

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

Issue 10106009: Fix a memory leak in a new test I added. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | « no previous file | no next file » | 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/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 } 270 }
271 271
272 TEST_F(OAuth2ApiCallFlowTest, CreateURLFetcher) { 272 TEST_F(OAuth2ApiCallFlowTest, CreateURLFetcher) {
273 std::string rt = "refresh_token"; 273 std::string rt = "refresh_token";
274 std::string at = "access_token"; 274 std::string at = "access_token";
275 std::vector<std::string> scopes(CreateTestScopes()); 275 std::vector<std::string> scopes(CreateTestScopes());
276 std::string body = CreateBody(); 276 std::string body = CreateBody();
277 GURL url(CreateApiUrl()); 277 GURL url(CreateApiUrl());
278 278
279 CreateFlow(rt, at, scopes); 279 CreateFlow(rt, at, scopes);
280 TestURLFetcher* url_fetcher = SetupApiCall(true, net::HTTP_OK); 280 scoped_ptr<TestURLFetcher> url_fetcher(SetupApiCall(true, net::HTTP_OK));
281 flow_->CreateURLFetcher(); 281 flow_->CreateURLFetcher();
282 HttpRequestHeaders headers; 282 HttpRequestHeaders headers;
283 url_fetcher->GetExtraRequestHeaders(&headers); 283 url_fetcher->GetExtraRequestHeaders(&headers);
284 std::string auth_header; 284 std::string auth_header;
285 EXPECT_TRUE(headers.GetHeader("Authorization", &auth_header)); 285 EXPECT_TRUE(headers.GetHeader("Authorization", &auth_header));
286 EXPECT_EQ("Bearer access_token", auth_header); 286 EXPECT_EQ("Bearer access_token", auth_header);
287 EXPECT_EQ(url, url_fetcher->GetOriginalURL()); 287 EXPECT_EQ(url, url_fetcher->GetOriginalURL());
288 EXPECT_EQ(body, url_fetcher->upload_data()); 288 EXPECT_EQ(body, url_fetcher->upload_data());
289 } 289 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698