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

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

Issue 1295523006: Using scoped_ptr for URLRequestJobFactoryImpl::SetProtocolHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing un-modified file Created 5 years, 4 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 | « net/url_request/url_request_unittest.cc ('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 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 std::string headers_; 51 std::string headers_;
52 std::string response_; 52 std::string response_;
53 }; 53 };
54 54
55 class SetResponseURLRequestContext: public net::TestURLRequestContext { 55 class SetResponseURLRequestContext: public net::TestURLRequestContext {
56 public: 56 public:
57 void SetResponse(const std::string& headers, const std::string& response) { 57 void SetResponse(const std::string& headers, const std::string& response) {
58 net::URLRequestJobFactoryImpl* factory = 58 net::URLRequestJobFactoryImpl* factory =
59 new net::URLRequestJobFactoryImpl(); 59 new net::URLRequestJobFactoryImpl();
60 factory->SetProtocolHandler( 60 factory->SetProtocolHandler(
61 "https", new FakeProtocolHandler(headers, response)); 61 "https", make_scoped_ptr(new FakeProtocolHandler(headers, response)));
62 context_storage_.set_job_factory(factory); 62 context_storage_.set_job_factory(factory);
63 } 63 }
64 }; 64 };
65 65
66 } // namespace 66 } // namespace
67 67
68 namespace remoting { 68 namespace remoting {
69 69
70 class TokenValidatorFactoryImplTest : public testing::Test { 70 class TokenValidatorFactoryImplTest : public testing::Test {
71 public: 71 public:
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 SetResponse(net::URLRequestTestJob::test_error_headers(), std::string()); 180 SetResponse(net::URLRequestTestJob::test_error_headers(), std::string());
181 181
182 token_validator_->ValidateThirdPartyToken( 182 token_validator_->ValidateThirdPartyToken(
183 kToken, base::Bind( 183 kToken, base::Bind(
184 &TokenValidatorFactoryImplTest::DeleteOnFailureCallback, 184 &TokenValidatorFactoryImplTest::DeleteOnFailureCallback,
185 base::Unretained(this))); 185 base::Unretained(this)));
186 message_loop_.Run(); 186 message_loop_.Run();
187 } 187 }
188 188
189 } // namespace remoting 189 } // namespace remoting
OLDNEW
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698