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

Side by Side Diff: remoting/host/token_validator_factory_impl_unittest.cc

Issue 16092013: Use base::MessageLoop in more files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again, sigh 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
« no previous file with comments | « remoting/host/setup/start_host.cc ('k') | sync/engine/sync_scheduler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 set of unit tests for TokenValidatorFactoryImpl 5 // A set of unit tests for TokenValidatorFactoryImpl
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 75
76 static std::string CreateErrorResponse(const std::string& error) { 76 static std::string CreateErrorResponse(const std::string& error) {
77 DictionaryValue response_dict; 77 DictionaryValue response_dict;
78 response_dict.SetString("error", error); 78 response_dict.SetString("error", error);
79 std::string response; 79 std::string response;
80 base::JSONWriter::Write(&response_dict, &response); 80 base::JSONWriter::Write(&response_dict, &response);
81 return response; 81 return response;
82 } 82 }
83 83
84 MessageLoop message_loop_; 84 base::MessageLoop message_loop_;
85 scoped_refptr<RsaKeyPair> key_pair_; 85 scoped_refptr<RsaKeyPair> key_pair_;
86 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; 86 scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
87 scoped_ptr<TokenValidatorFactoryImpl> token_validator_factory_; 87 scoped_ptr<TokenValidatorFactoryImpl> token_validator_factory_;
88 scoped_ptr<protocol::ThirdPartyHostAuthenticator::TokenValidator> 88 scoped_ptr<protocol::ThirdPartyHostAuthenticator::TokenValidator>
89 token_validator_; 89 token_validator_;
90 }; 90 };
91 91
92 TEST_F(TokenValidatorFactoryImplTest, Success) { 92 TEST_F(TokenValidatorFactoryImplTest, Success) {
93 net::FakeURLFetcherFactory factory(NULL); 93 net::FakeURLFetcherFactory factory(NULL);
94 token_validator_ = token_validator_factory_->CreateTokenValidator( 94 token_validator_ = token_validator_factory_->CreateTokenValidator(
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 kLocalJid, kRemoteJid); 129 kLocalJid, kRemoteJid);
130 factory.SetFakeResponse(kTokenValidationUrl, std::string(), false); 130 factory.SetFakeResponse(kTokenValidationUrl, std::string(), false);
131 token_validator_->ValidateThirdPartyToken( 131 token_validator_->ValidateThirdPartyToken(
132 kToken, base::Bind( 132 kToken, base::Bind(
133 &TokenValidatorFactoryImplTest::DeleteOnFailureCallback, 133 &TokenValidatorFactoryImplTest::DeleteOnFailureCallback,
134 base::Unretained(this))); 134 base::Unretained(this)));
135 message_loop_.Run(); 135 message_loop_.Run();
136 } 136 }
137 137
138 } // namespace remoting 138 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/setup/start_host.cc ('k') | sync/engine/sync_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698