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

Side by Side Diff: chrome/browser/ui/app_list/speech_auth_helper_unittest.cc

Issue 1143323005: Refactor AO2TS to make it easier to componentize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: works for all platforms commit e75a498951318d4deb65d40ce8b2def44cd5abc0 Created 5 years, 6 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698