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

Side by Side Diff: net/ocsp/nss_ocsp_unittest.cc

Issue 657013003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/http/http_stream_parser_unittest.cc ('k') | net/quic/quic_end_to_end_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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "net/ocsp/nss_ocsp.h" 5 #include "net/ocsp/nss_ocsp.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 &file_contents)); 84 &file_contents));
85 ASSERT_FALSE(file_contents.empty()); 85 ASSERT_FALSE(file_contents.empty());
86 86
87 // Ownership of |handler| is transferred to the URLRequestFilter, but 87 // Ownership of |handler| is transferred to the URLRequestFilter, but
88 // hold onto the original pointer in order to access |request_count()|. 88 // hold onto the original pointer in order to access |request_count()|.
89 scoped_ptr<AiaResponseHandler> handler( 89 scoped_ptr<AiaResponseHandler> handler(
90 new AiaResponseHandler(kAiaHeaders, file_contents)); 90 new AiaResponseHandler(kAiaHeaders, file_contents));
91 handler_ = handler.get(); 91 handler_ = handler.get();
92 92
93 URLRequestFilter::GetInstance()->AddHostnameInterceptor( 93 URLRequestFilter::GetInstance()->AddHostnameInterceptor(
94 "http", 94 "http", kAiaHost, handler.Pass());
95 kAiaHost,
96 handler.PassAs<URLRequestInterceptor>());
97 95
98 SetURLRequestContextForNSSHttpIO(&context_); 96 SetURLRequestContextForNSSHttpIO(&context_);
99 EnsureNSSHttpIOInit(); 97 EnsureNSSHttpIOInit();
100 } 98 }
101 99
102 virtual void TearDown() { 100 virtual void TearDown() {
103 ShutdownNSSHttpIO(); 101 ShutdownNSSHttpIO();
104 102
105 if (handler_) 103 if (handler_)
106 URLRequestFilter::GetInstance()->RemoveHostnameHandler("http", kAiaHost); 104 URLRequestFilter::GetInstance()->RemoveHostnameHandler("http", kAiaHost);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 153
156 error = test_callback.WaitForResult(); 154 error = test_callback.WaitForResult();
157 155
158 EXPECT_EQ(OK, error); 156 EXPECT_EQ(OK, error);
159 157
160 // Ensure that NSS made an AIA request for the missing intermediate. 158 // Ensure that NSS made an AIA request for the missing intermediate.
161 EXPECT_LT(0, request_count()); 159 EXPECT_LT(0, request_count());
162 } 160 }
163 161
164 } // namespace net 162 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_stream_parser_unittest.cc ('k') | net/quic/quic_end_to_end_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698