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

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

Issue 15987009: Update chrome/ to use WeakPtr<T>::get() instead of implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 void MockProfileOAuth2TokenService::SetExpectation(bool success, 126 void MockProfileOAuth2TokenService::SetExpectation(bool success,
127 std::string oauth2_access_token) { 127 std::string oauth2_access_token) {
128 success_ = success; 128 success_ = success;
129 oauth2_access_token_ = oauth2_access_token; 129 oauth2_access_token_ = oauth2_access_token;
130 } 130 }
131 131
132 // static 132 // static
133 void MockProfileOAuth2TokenService::InformConsumer( 133 void MockProfileOAuth2TokenService::InformConsumer(
134 base::WeakPtr<MockProfileOAuth2TokenService::Request> request) { 134 base::WeakPtr<MockProfileOAuth2TokenService::Request> request) {
135 if (request) 135 if (request.get())
136 request->InformConsumer(); 136 request->InformConsumer();
137 } 137 }
138 138
139 scoped_ptr<OAuth2TokenService::Request> 139 scoped_ptr<OAuth2TokenService::Request>
140 MockProfileOAuth2TokenService::StartRequest( 140 MockProfileOAuth2TokenService::StartRequest(
141 const std::set<std::string>& scopes, 141 const std::set<std::string>& scopes,
142 OAuth2TokenService::Consumer* consumer) { 142 OAuth2TokenService::Consumer* consumer) {
143 scoped_ptr<Request> request; 143 scoped_ptr<Request> request;
144 if (success_) { 144 if (success_) {
145 request.reset(new MockProfileOAuth2TokenService::Request( 145 request.reset(new MockProfileOAuth2TokenService::Request(
(...skipping 87 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
« no previous file with comments | « chrome/browser/signin/oauth2_token_service.cc ('k') | chrome/browser/sync/glue/generic_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698