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

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

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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 (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 "google_apis/gaia/oauth2_mint_token_flow.h" 7 #include "google_apis/gaia/oauth2_mint_token_flow.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 std::vector<std::string> scopes(CreateTestScopes()); 173 std::vector<std::string> scopes(CreateTestScopes());
174 flow_.reset(new MockMintTokenFlow( 174 flow_.reset(new MockMintTokenFlow(
175 delegate, OAuth2MintTokenFlow::Parameters(ext_id, client_id, scopes, 175 delegate, OAuth2MintTokenFlow::Parameters(ext_id, client_id, scopes,
176 device_id, mode))); 176 device_id, mode)));
177 } 177 }
178 178
179 // Helper to parse the given string to DictionaryValue. 179 // Helper to parse the given string to DictionaryValue.
180 static base::DictionaryValue* ParseJson(const std::string& str) { 180 static base::DictionaryValue* ParseJson(const std::string& str) {
181 std::unique_ptr<base::Value> value = base::JSONReader::Read(str); 181 std::unique_ptr<base::Value> value = base::JSONReader::Read(str);
182 EXPECT_TRUE(value.get()); 182 EXPECT_TRUE(value.get());
183 EXPECT_EQ(base::Value::TYPE_DICTIONARY, value->GetType()); 183 EXPECT_EQ(base::Value::Type::DICTIONARY, value->GetType());
184 return static_cast<base::DictionaryValue*>(value.release()); 184 return static_cast<base::DictionaryValue*>(value.release());
185 } 185 }
186 186
187 std::unique_ptr<MockMintTokenFlow> flow_; 187 std::unique_ptr<MockMintTokenFlow> flow_;
188 StrictMock<MockDelegate> delegate_; 188 StrictMock<MockDelegate> delegate_;
189 }; 189 };
190 190
191 TEST_F(OAuth2MintTokenFlowTest, CreateApiCallBody) { 191 TEST_F(OAuth2MintTokenFlowTest, CreateApiCallBody) {
192 { // Issue advice mode. 192 { // Issue advice mode.
193 CreateFlow(OAuth2MintTokenFlow::MODE_ISSUE_ADVICE); 193 CreateFlow(OAuth2MintTokenFlow::MODE_ISSUE_ADVICE);
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 360 }
361 361
362 { // Non-null delegate. 362 { // Non-null delegate.
363 TestURLFetcher url_fetcher(1, GURL("http://www.google.com"), NULL); 363 TestURLFetcher url_fetcher(1, GURL("http://www.google.com"), NULL);
364 url_fetcher.set_status(URLRequestStatus::FromError(net::ERR_FAILED)); 364 url_fetcher.set_status(URLRequestStatus::FromError(net::ERR_FAILED));
365 CreateFlow(OAuth2MintTokenFlow::MODE_MINT_TOKEN_NO_FORCE); 365 CreateFlow(OAuth2MintTokenFlow::MODE_MINT_TOKEN_NO_FORCE);
366 EXPECT_CALL(delegate_, OnMintTokenFailure(_)); 366 EXPECT_CALL(delegate_, OnMintTokenFailure(_));
367 flow_->ProcessApiCallFailure(&url_fetcher); 367 flow_->ProcessApiCallFailure(&url_fetcher);
368 } 368 }
369 } 369 }
OLDNEW
« no previous file with comments | « google_apis/gaia/oauth2_access_token_fetcher_impl.cc ('k') | gpu/tools/compositor_model_bench/render_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698