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

Side by Side Diff: google_apis/gaia/gaia_oauth_client_unittest.cc

Issue 1086453003: Update {virtual,override} to follow C++11 style in google_apis. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « google_apis/drive/drive_api_requests.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // 4 //
5 // A complete set of unit tests for GaiaOAuthClient. 5 // A complete set of unit tests for GaiaOAuthClient.
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 MOCK_METHOD1(OnGetUserIdResponse, void(const std::string& user_id)); 211 MOCK_METHOD1(OnGetUserIdResponse, void(const std::string& user_id));
212 MOCK_METHOD0(OnOAuthError, void()); 212 MOCK_METHOD0(OnOAuthError, void());
213 MOCK_METHOD1(OnNetworkError, void(int response_code)); 213 MOCK_METHOD1(OnNetworkError, void(int response_code));
214 214
215 // gMock doesn't like methods that take or return scoped_ptr. A 215 // gMock doesn't like methods that take or return scoped_ptr. A
216 // work-around is to create a mock method that takes a raw ptr, and 216 // work-around is to create a mock method that takes a raw ptr, and
217 // override the problematic method to call through to it. 217 // override the problematic method to call through to it.
218 // https://groups.google.com/a/chromium.org/d/msg/chromium-dev/01sDxsJ1OYw/I_S 0xCBRF2oJ 218 // https://groups.google.com/a/chromium.org/d/msg/chromium-dev/01sDxsJ1OYw/I_S 0xCBRF2oJ
219 MOCK_METHOD1(OnGetUserInfoResponsePtr, 219 MOCK_METHOD1(OnGetUserInfoResponsePtr,
220 void(const base::DictionaryValue* user_info)); 220 void(const base::DictionaryValue* user_info));
221 virtual void OnGetUserInfoResponse( 221 void OnGetUserInfoResponse(
222 scoped_ptr<base::DictionaryValue> user_info) override { 222 scoped_ptr<base::DictionaryValue> user_info) override {
223 user_info_.reset(user_info.release()); 223 user_info_.reset(user_info.release());
224 OnGetUserInfoResponsePtr(user_info_.get()); 224 OnGetUserInfoResponsePtr(user_info_.get());
225 } 225 }
226 MOCK_METHOD1(OnGetTokenInfoResponsePtr, 226 MOCK_METHOD1(OnGetTokenInfoResponsePtr,
227 void(const base::DictionaryValue* token_info)); 227 void(const base::DictionaryValue* token_info));
228 virtual void OnGetTokenInfoResponse( 228 void OnGetTokenInfoResponse(
229 scoped_ptr<base::DictionaryValue> token_info) override { 229 scoped_ptr<base::DictionaryValue> token_info) override {
230 token_info_.reset(token_info.release()); 230 token_info_.reset(token_info.release());
231 OnGetTokenInfoResponsePtr(token_info_.get()); 231 OnGetTokenInfoResponsePtr(token_info_.get());
232 } 232 }
233 233
234 private: 234 private:
235 scoped_ptr<base::DictionaryValue> user_info_; 235 scoped_ptr<base::DictionaryValue> user_info_;
236 scoped_ptr<base::DictionaryValue> token_info_; 236 scoped_ptr<base::DictionaryValue> token_info_;
237 DISALLOW_COPY_AND_ASSIGN(MockGaiaOAuthClientDelegate); 237 DISALLOW_COPY_AND_ASSIGN(MockGaiaOAuthClientDelegate);
238 }; 238 };
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 406
407 GaiaOAuthClient auth(GetRequestContext()); 407 GaiaOAuthClient auth(GetRequestContext());
408 auth.GetTokenHandleInfo("some_handle", 1, &delegate); 408 auth.GetTokenHandleInfo("some_handle", 1, &delegate);
409 409
410 std::string audience; 410 std::string audience;
411 ASSERT_TRUE(captured_result->GetString("audience", &audience)); 411 ASSERT_TRUE(captured_result->GetString("audience", &audience));
412 ASSERT_EQ("1234567890.apps.googleusercontent.com", audience); 412 ASSERT_EQ("1234567890.apps.googleusercontent.com", audience);
413 } 413 }
414 414
415 } // namespace gaia 415 } // namespace gaia
OLDNEW
« no previous file with comments | « google_apis/drive/drive_api_requests.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698