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 "chrome/browser/ui/app_list/speech_auth_helper.h" | 5 #include "chrome/browser/ui/app_list/speech_auth_helper.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 std::string(), | 53 std::string(), |
54 factories); | 54 factories); |
55 | 55 |
56 // Set up the authenticated user name and ID. | 56 // Set up the authenticated user name and ID. |
57 SigninManagerFactory::GetForProfile(profile_)->SetAuthenticatedAccountInfo( | 57 SigninManagerFactory::GetForProfile(profile_)->SetAuthenticatedAccountInfo( |
58 kTestGaiaId, kTestUser); | 58 kTestGaiaId, kTestUser); |
59 } | 59 } |
60 | 60 |
61 protected: | 61 protected: |
62 void SetupRefreshToken() { | 62 void SetupRefreshToken() { |
63 GetFakeProfileOAuth2TokenService()->IssueRefreshTokenForUser( | 63 GetFakeProfileOAuth2TokenService()->UpdateCredentials(kTestUser, |
64 kTestUser, "fake_refresh_token"); | 64 "fake_refresh_token"); |
65 } | 65 } |
66 | 66 |
67 FakeProfileOAuth2TokenService* GetFakeProfileOAuth2TokenService() { | 67 FakeProfileOAuth2TokenService* GetFakeProfileOAuth2TokenService() { |
68 return static_cast<FakeProfileOAuth2TokenService*>( | 68 return static_cast<FakeProfileOAuth2TokenService*>( |
69 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)); | 69 ProfileOAuth2TokenServiceFactory::GetForProfile(profile_)); |
70 } | 70 } |
71 | 71 |
72 base::SimpleTestClock test_clock_; | 72 base::SimpleTestClock test_clock_; |
73 content::TestBrowserThreadBundle thread_bundle; | 73 content::TestBrowserThreadBundle thread_bundle; |
74 scoped_ptr<TestingProfileManager> testing_profile_manager_; | 74 scoped_ptr<TestingProfileManager> testing_profile_manager_; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 OAuth2TokenService::ScopeSet scopes; | 114 OAuth2TokenService::ScopeSet scopes; |
115 scopes.insert(kScope); | 115 scopes.insert(kScope); |
116 GetFakeProfileOAuth2TokenService()->IssueErrorForScope( | 116 GetFakeProfileOAuth2TokenService()->IssueErrorForScope( |
117 scopes, GoogleServiceAuthError(GoogleServiceAuthError::SERVICE_ERROR)); | 117 scopes, GoogleServiceAuthError(GoogleServiceAuthError::SERVICE_ERROR)); |
118 | 118 |
119 EXPECT_TRUE(helper.GetToken().empty()); | 119 EXPECT_TRUE(helper.GetToken().empty()); |
120 EXPECT_EQ(kScope, helper.GetScope()); | 120 EXPECT_EQ(kScope, helper.GetScope()); |
121 } | 121 } |
122 | 122 |
123 } // namespace app_list | 123 } // namespace app_list |
OLD | NEW |