OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "components/signin/ios/browser/profile_oauth2_token_service_ios.h" | 5 #include "components/signin/ios/browser/profile_oauth2_token_service_ios.h" |
6 | 6 |
7 #include "base/run_loop.h" | |
8 #include "base/prefs/pref_registry_simple.h" | 7 #include "base/prefs/pref_registry_simple.h" |
9 #include "base/prefs/testing_pref_service.h" | 8 #include "base/prefs/testing_pref_service.h" |
| 9 #include "base/run_loop.h" |
10 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 10 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| 11 #include "components/signin/core/browser/test_signin_client.h" |
11 #include "components/signin/core/common/signin_pref_names.h" | 12 #include "components/signin/core/common/signin_pref_names.h" |
12 #include "components/signin/core/browser/test_signin_client.h" | |
13 #include "google_apis/gaia/gaia_urls.h" | 13 #include "google_apis/gaia/gaia_urls.h" |
14 #include "google_apis/gaia/oauth2_access_token_consumer.h" | 14 #include "google_apis/gaia/oauth2_access_token_consumer.h" |
15 #include "google_apis/gaia/oauth2_token_service_test_util.h" | 15 #include "google_apis/gaia/oauth2_token_service_test_util.h" |
16 #include "ios/public/test/fake_profile_oauth2_token_service_ios_provider.h" | 16 #include "ios/public/test/fake_profile_oauth2_token_service_ios_provider.h" |
17 #include "net/url_request/test_url_fetcher_factory.h" | 17 #include "net/url_request/test_url_fetcher_factory.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 | 19 |
20 class ProfileOAuth2TokenServiceIOSTest : public testing::Test, | 20 class ProfileOAuth2TokenServiceIOSTest : public testing::Test, |
21 public OAuth2TokenService::Consumer, | 21 public OAuth2TokenService::Consumer, |
22 public OAuth2TokenService::Observer { | 22 public OAuth2TokenService::Observer { |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 base::RunLoop().RunUntilIdle(); | 395 base::RunLoop().RunUntilIdle(); |
396 | 396 |
397 EXPECT_EQ(tester.token_failures().size(), 2u); | 397 EXPECT_EQ(tester.token_failures().size(), 2u); |
398 // Request cancelled by |CancelRequestsForAccount| in |RemoveAccount|. | 398 // Request cancelled by |CancelRequestsForAccount| in |RemoveAccount|. |
399 EXPECT_EQ(tester.token_failures()[0].state(), | 399 EXPECT_EQ(tester.token_failures()[0].state(), |
400 GoogleServiceAuthError::REQUEST_CANCELED); | 400 GoogleServiceAuthError::REQUEST_CANCELED); |
401 // Request failing as the account is marked for removal. | 401 // Request failing as the account is marked for removal. |
402 EXPECT_EQ(tester.token_failures()[1].state(), | 402 EXPECT_EQ(tester.token_failures()[1].state(), |
403 GoogleServiceAuthError::USER_NOT_SIGNED_UP); | 403 GoogleServiceAuthError::USER_NOT_SIGNED_UP); |
404 } | 404 } |
OLD | NEW |