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

Side by Side Diff: net/test/embedded_test_server/embedded_test_server_unittest.cc

Issue 2090613002: Remove calls to deprecated MessageLoop methods in net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/socket/ssl_server_socket_unittest.cc ('k') | net/tools/gdig/gdig.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) 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> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 ++num_responses_received_; 156 ++num_responses_received_;
157 if (num_responses_received_ == num_responses_expected_) 157 if (num_responses_received_ == num_responses_expected_)
158 base::MessageLoop::current()->QuitWhenIdle(); 158 base::MessageLoop::current()->QuitWhenIdle();
159 } 159 }
160 160
161 // Waits until the specified number of responses are received. 161 // Waits until the specified number of responses are received.
162 void WaitForResponses(int num_responses) { 162 void WaitForResponses(int num_responses) {
163 num_responses_received_ = 0; 163 num_responses_received_ = 0;
164 num_responses_expected_ = num_responses; 164 num_responses_expected_ = num_responses;
165 // Will be terminated in OnURLFetchComplete(). 165 // Will be terminated in OnURLFetchComplete().
166 base::MessageLoop::current()->Run(); 166 base::RunLoop().Run();
167 } 167 }
168 168
169 // Handles |request| sent to |path| and returns the response per |content|, 169 // Handles |request| sent to |path| and returns the response per |content|,
170 // |content type|, and |code|. Saves the request URL for verification. 170 // |content type|, and |code|. Saves the request URL for verification.
171 std::unique_ptr<HttpResponse> HandleRequest(const std::string& path, 171 std::unique_ptr<HttpResponse> HandleRequest(const std::string& path,
172 const std::string& content, 172 const std::string& content,
173 const std::string& content_type, 173 const std::string& content_type,
174 HttpStatusCode code, 174 HttpStatusCode code,
175 const HttpRequest& request) { 175 const HttpRequest& request) {
176 request_relative_url_ = request.relative_url; 176 request_relative_url_ = request.relative_url;
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 INSTANTIATE_TEST_CASE_P( 593 INSTANTIATE_TEST_CASE_P(
594 EmbeddedTestServerThreadingTestInstantiation, 594 EmbeddedTestServerThreadingTestInstantiation,
595 EmbeddedTestServerThreadingTest, 595 EmbeddedTestServerThreadingTest,
596 testing::Combine(testing::Bool(), 596 testing::Combine(testing::Bool(),
597 testing::Bool(), 597 testing::Bool(),
598 testing::Values(EmbeddedTestServer::TYPE_HTTP, 598 testing::Values(EmbeddedTestServer::TYPE_HTTP,
599 EmbeddedTestServer::TYPE_HTTPS))); 599 EmbeddedTestServer::TYPE_HTTPS)));
600 600
601 } // namespace test_server 601 } // namespace test_server
602 } // namespace net 602 } // namespace net
OLDNEW
« no previous file with comments | « net/socket/ssl_server_socket_unittest.cc ('k') | net/tools/gdig/gdig.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698