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

Side by Side Diff: google_apis/gaia/gaia_oauth_client_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 GaiaOAuthClient. 5 // A complete set of unit tests for GaiaOAuthClient.
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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 365
366 MockOAuthFetcherFactory factory; 366 MockOAuthFetcherFactory factory;
367 factory.set_results(kDummyFullUserInfoResult); 367 factory.set_results(kDummyFullUserInfoResult);
368 368
369 GaiaOAuthClient auth(GetRequestContext()); 369 GaiaOAuthClient auth(GetRequestContext());
370 auth.GetUserInfo("access_token", 1, &delegate); 370 auth.GetUserInfo("access_token", 1, &delegate);
371 371
372 std::unique_ptr<base::Value> value = 372 std::unique_ptr<base::Value> value =
373 base::JSONReader::Read(kDummyFullUserInfoResult); 373 base::JSONReader::Read(kDummyFullUserInfoResult);
374 DCHECK(value); 374 DCHECK(value);
375 ASSERT_TRUE(value->IsType(base::Value::TYPE_DICTIONARY)); 375 ASSERT_TRUE(value->IsType(base::Value::Type::DICTIONARY));
376 base::DictionaryValue* expected_result; 376 base::DictionaryValue* expected_result;
377 value->GetAsDictionary(&expected_result); 377 value->GetAsDictionary(&expected_result);
378 378
379 ASSERT_TRUE(expected_result->Equals(captured_result)); 379 ASSERT_TRUE(expected_result->Equals(captured_result));
380 } 380 }
381 381
382 TEST_F(GaiaOAuthClientTest, GetTokenInfo) { 382 TEST_F(GaiaOAuthClientTest, GetTokenInfo) {
383 const base::DictionaryValue* captured_result; 383 const base::DictionaryValue* captured_result;
384 384
385 MockGaiaOAuthClientDelegate delegate; 385 MockGaiaOAuthClientDelegate delegate;
(...skipping 23 matching lines...) Expand all
409 409
410 GaiaOAuthClient auth(GetRequestContext()); 410 GaiaOAuthClient auth(GetRequestContext());
411 auth.GetTokenHandleInfo("some_handle", 1, &delegate); 411 auth.GetTokenHandleInfo("some_handle", 1, &delegate);
412 412
413 std::string audience; 413 std::string audience;
414 ASSERT_TRUE(captured_result->GetString("audience", &audience)); 414 ASSERT_TRUE(captured_result->GetString("audience", &audience));
415 ASSERT_EQ("1234567890.apps.googleusercontent.com", audience); 415 ASSERT_EQ("1234567890.apps.googleusercontent.com", audience);
416 } 416 }
417 417
418 } // namespace gaia 418 } // namespace gaia
OLDNEW
« no previous file with comments | « google_apis/gaia/gaia_oauth_client.cc ('k') | google_apis/gaia/oauth2_access_token_fetcher_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698