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

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

Issue 1545233002: Convert Pass()→std::move() in //net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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/cert_net/nss_ocsp.cc ('k') | net/disk_cache/backend_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/cert_net/nss_ocsp.h" 5 #include "net/cert_net/nss_ocsp.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility>
8 9
9 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
10 #include "base/files/file_util.h" 11 #include "base/files/file_util.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "base/memory/ref_counted.h" 14 #include "base/memory/ref_counted.h"
14 #include "net/base/net_errors.h" 15 #include "net/base/net_errors.h"
15 #include "net/base/test_completion_callback.h" 16 #include "net/base/test_completion_callback.h"
16 #include "net/base/test_data_directory.h" 17 #include "net/base/test_data_directory.h"
17 #include "net/cert/cert_status_flags.h" 18 #include "net/cert/cert_status_flags.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 GetTestCertsDirectory().AppendASCII("aia-intermediate.der"), 85 GetTestCertsDirectory().AppendASCII("aia-intermediate.der"),
85 &file_contents)); 86 &file_contents));
86 ASSERT_FALSE(file_contents.empty()); 87 ASSERT_FALSE(file_contents.empty());
87 88
88 // Ownership of |handler| is transferred to the URLRequestFilter, but 89 // Ownership of |handler| is transferred to the URLRequestFilter, but
89 // hold onto the original pointer in order to access |request_count()|. 90 // hold onto the original pointer in order to access |request_count()|.
90 scoped_ptr<AiaResponseHandler> handler( 91 scoped_ptr<AiaResponseHandler> handler(
91 new AiaResponseHandler(kAiaHeaders, file_contents)); 92 new AiaResponseHandler(kAiaHeaders, file_contents));
92 handler_ = handler.get(); 93 handler_ = handler.get();
93 94
94 URLRequestFilter::GetInstance()->AddHostnameInterceptor( 95 URLRequestFilter::GetInstance()->AddHostnameInterceptor("http", kAiaHost,
95 "http", kAiaHost, handler.Pass()); 96 std::move(handler));
96 97
97 SetURLRequestContextForNSSHttpIO(&context_); 98 SetURLRequestContextForNSSHttpIO(&context_);
98 EnsureNSSHttpIOInit(); 99 EnsureNSSHttpIOInit();
99 } 100 }
100 101
101 void TearDown() override { 102 void TearDown() override {
102 ShutdownNSSHttpIO(); 103 ShutdownNSSHttpIO();
103 104
104 if (handler_) 105 if (handler_)
105 URLRequestFilter::GetInstance()->RemoveHostnameHandler("http", kAiaHost); 106 URLRequestFilter::GetInstance()->RemoveHostnameHandler("http", kAiaHost);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 150
150 error = test_callback.WaitForResult(); 151 error = test_callback.WaitForResult();
151 152
152 EXPECT_EQ(OK, error); 153 EXPECT_EQ(OK, error);
153 154
154 // Ensure that NSS made an AIA request for the missing intermediate. 155 // Ensure that NSS made an AIA request for the missing intermediate.
155 EXPECT_LT(0, request_count()); 156 EXPECT_LT(0, request_count());
156 } 157 }
157 158
158 } // namespace net 159 } // namespace net
OLDNEW
« no previous file with comments | « net/cert_net/nss_ocsp.cc ('k') | net/disk_cache/backend_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698