OLD | NEW |
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 #include "net/test/embedded_test_server/embedded_test_server.h" | 5 #include "net/test/embedded_test_server/embedded_test_server.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/macros.h" | 9 #include "base/macros.h" |
8 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
9 #include "base/path_service.h" | 11 #include "base/path_service.h" |
10 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
11 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
12 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
13 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
14 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
15 #include "crypto/nss_util.h" | 17 #include "crypto/nss_util.h" |
16 #include "net/base/test_completion_callback.h" | 18 #include "net/base/test_completion_callback.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 HttpStatusCode code, | 173 HttpStatusCode code, |
172 const HttpRequest& request) { | 174 const HttpRequest& request) { |
173 request_relative_url_ = request.relative_url; | 175 request_relative_url_ = request.relative_url; |
174 | 176 |
175 GURL absolute_url = server_->GetURL(request.relative_url); | 177 GURL absolute_url = server_->GetURL(request.relative_url); |
176 if (absolute_url.path() == path) { | 178 if (absolute_url.path() == path) { |
177 scoped_ptr<BasicHttpResponse> http_response(new BasicHttpResponse); | 179 scoped_ptr<BasicHttpResponse> http_response(new BasicHttpResponse); |
178 http_response->set_code(code); | 180 http_response->set_code(code); |
179 http_response->set_content(content); | 181 http_response->set_content(content); |
180 http_response->set_content_type(content_type); | 182 http_response->set_content_type(content_type); |
181 return http_response.Pass(); | 183 return std::move(http_response); |
182 } | 184 } |
183 | 185 |
184 return nullptr; | 186 return nullptr; |
185 } | 187 } |
186 | 188 |
187 protected: | 189 protected: |
188 int num_responses_received_; | 190 int num_responses_received_; |
189 int num_responses_expected_; | 191 int num_responses_expected_; |
190 std::string request_relative_url_; | 192 std::string request_relative_url_; |
191 base::Thread io_thread_; | 193 base::Thread io_thread_; |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 INSTANTIATE_TEST_CASE_P( | 591 INSTANTIATE_TEST_CASE_P( |
590 EmbeddedTestServerThreadingTestInstantiation, | 592 EmbeddedTestServerThreadingTestInstantiation, |
591 EmbeddedTestServerThreadingTest, | 593 EmbeddedTestServerThreadingTest, |
592 testing::Combine(testing::Bool(), | 594 testing::Combine(testing::Bool(), |
593 testing::Bool(), | 595 testing::Bool(), |
594 testing::Values(EmbeddedTestServer::TYPE_HTTP, | 596 testing::Values(EmbeddedTestServer::TYPE_HTTP, |
595 EmbeddedTestServer::TYPE_HTTPS))); | 597 EmbeddedTestServer::TYPE_HTTPS))); |
596 | 598 |
597 } // namespace test_server | 599 } // namespace test_server |
598 } // namespace net | 600 } // namespace net |
OLD | NEW |