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

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

Issue 1184713004: google_apis: Migrate callers of message_loop_proxy() to task_runner() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. 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 (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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 void SetUp() override { 181 void SetUp() override {
182 client_info_.client_id = "test_client_id"; 182 client_info_.client_id = "test_client_id";
183 client_info_.client_secret = "test_client_secret"; 183 client_info_.client_secret = "test_client_secret";
184 client_info_.redirect_uri = "test_redirect_uri"; 184 client_info_.redirect_uri = "test_redirect_uri";
185 }; 185 };
186 186
187 protected: 187 protected:
188 net::TestURLRequestContextGetter* GetRequestContext() { 188 net::TestURLRequestContextGetter* GetRequestContext() {
189 if (!request_context_getter_.get()) { 189 if (!request_context_getter_.get()) {
190 request_context_getter_ = new net::TestURLRequestContextGetter( 190 request_context_getter_ = new net::TestURLRequestContextGetter(
191 message_loop_.message_loop_proxy()); 191 message_loop_.task_runner());
192 } 192 }
193 return request_context_getter_.get(); 193 return request_context_getter_.get();
194 } 194 }
195 195
196 base::MessageLoop message_loop_; 196 base::MessageLoop message_loop_;
197 scoped_refptr<net::TestURLRequestContextGetter> request_context_getter_; 197 scoped_refptr<net::TestURLRequestContextGetter> request_context_getter_;
198 OAuthClientInfo client_info_; 198 OAuthClientInfo client_info_;
199 }; 199 };
200 200
201 class MockGaiaOAuthClientDelegate : public gaia::GaiaOAuthClient::Delegate { 201 class MockGaiaOAuthClientDelegate : public gaia::GaiaOAuthClient::Delegate {
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 407
408 GaiaOAuthClient auth(GetRequestContext()); 408 GaiaOAuthClient auth(GetRequestContext());
409 auth.GetTokenHandleInfo("some_handle", 1, &delegate); 409 auth.GetTokenHandleInfo("some_handle", 1, &delegate);
410 410
411 std::string audience; 411 std::string audience;
412 ASSERT_TRUE(captured_result->GetString("audience", &audience)); 412 ASSERT_TRUE(captured_result->GetString("audience", &audience));
413 ASSERT_EQ("1234567890.apps.googleusercontent.com", audience); 413 ASSERT_EQ("1234567890.apps.googleusercontent.com", audience);
414 } 414 }
415 415
416 } // namespace gaia 416 } // namespace gaia
OLDNEW
« no previous file with comments | « google_apis/gaia/gaia_auth_fetcher_unittest.cc ('k') | google_apis/gaia/oauth2_api_call_flow_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698