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

Side by Side Diff: chrome/browser/signin/profile_oauth2_token_service_request_unittest.cc

Issue 14141006: [components] Switch {RefCounted}ProfileKeyedService to use BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for review Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #include "chrome/browser/signin/profile_oauth2_token_service_request.h" 4 #include "chrome/browser/signin/profile_oauth2_token_service_request.h"
5 5
6 #include <set> 6 #include <set>
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "chrome/browser/signin/oauth2_token_service.h" 10 #include "chrome/browser/signin/oauth2_token_service.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 request.reset(new MockProfileOAuth2TokenService::Request( 150 request.reset(new MockProfileOAuth2TokenService::Request(
151 consumer, 151 consumer,
152 GoogleServiceAuthError(GoogleServiceAuthError::SERVICE_UNAVAILABLE), 152 GoogleServiceAuthError(GoogleServiceAuthError::SERVICE_UNAVAILABLE),
153 std::string())); 153 std::string()));
154 } 154 }
155 MessageLoop::current()->PostTask(FROM_HERE, base::Bind( 155 MessageLoop::current()->PostTask(FROM_HERE, base::Bind(
156 &MockProfileOAuth2TokenService::InformConsumer, request->AsWeakPtr())); 156 &MockProfileOAuth2TokenService::InformConsumer, request->AsWeakPtr()));
157 return request.PassAs<OAuth2TokenService::Request>(); 157 return request.PassAs<OAuth2TokenService::Request>();
158 } 158 }
159 159
160 static ProfileKeyedService* CreateOAuth2TokenService(Profile* profile) { 160 static ProfileKeyedService* CreateOAuth2TokenService(
161 content::BrowserContext* profile) {
161 return new MockProfileOAuth2TokenService(); 162 return new MockProfileOAuth2TokenService();
162 } 163 }
163 164
164 class ProfileOAuth2TokenServiceRequestTest : public testing::Test { 165 class ProfileOAuth2TokenServiceRequestTest : public testing::Test {
165 public: 166 public:
166 virtual void SetUp() OVERRIDE; 167 virtual void SetUp() OVERRIDE;
167 168
168 protected: 169 protected:
169 MessageLoop ui_loop_; 170 MessageLoop ui_loop_;
170 scoped_ptr<content::TestBrowserThread> ui_thread_; 171 scoped_ptr<content::TestBrowserThread> ui_thread_;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 profile_.get(), 233 profile_.get(),
233 std::set<std::string>(), 234 std::set<std::string>(),
234 &consumer_)); 235 &consumer_));
235 ui_loop_.RunUntilIdle(); 236 ui_loop_.RunUntilIdle();
236 request.reset(); 237 request.reset();
237 EXPECT_EQ(1, consumer_.number_of_successful_tokens_); 238 EXPECT_EQ(1, consumer_.number_of_successful_tokens_);
238 EXPECT_EQ(0, consumer_.number_of_errors_); 239 EXPECT_EQ(0, consumer_.number_of_errors_);
239 } 240 }
240 241
241 } // namespace 242 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698