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

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

Issue 15517005: Remove references to Profile from browser_context_keyed_service. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase & style Created 7 years, 7 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( 160 static BrowserContextKeyedService* CreateOAuth2TokenService(
161 content::BrowserContext* profile) { 161 content::BrowserContext* profile) {
162 return new MockProfileOAuth2TokenService(); 162 return new MockProfileOAuth2TokenService();
163 } 163 }
164 164
165 class ProfileOAuth2TokenServiceRequestTest : public testing::Test { 165 class ProfileOAuth2TokenServiceRequestTest : public testing::Test {
166 public: 166 public:
167 virtual void SetUp() OVERRIDE; 167 virtual void SetUp() OVERRIDE;
168 168
169 protected: 169 protected:
170 MessageLoop ui_loop_; 170 MessageLoop ui_loop_;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 profile_.get(), 233 profile_.get(),
234 std::set<std::string>(), 234 std::set<std::string>(),
235 &consumer_)); 235 &consumer_));
236 ui_loop_.RunUntilIdle(); 236 ui_loop_.RunUntilIdle();
237 request.reset(); 237 request.reset();
238 EXPECT_EQ(1, consumer_.number_of_successful_tokens_); 238 EXPECT_EQ(1, consumer_.number_of_successful_tokens_);
239 EXPECT_EQ(0, consumer_.number_of_errors_); 239 EXPECT_EQ(0, consumer_.number_of_errors_);
240 } 240 }
241 241
242 } // namespace 242 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698