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

Side by Side Diff: net/http/http_stream_factory_impl_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, 6 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_response_body_drainer_unittest.cc ('k') | net/proxy/mock_proxy_script_fetcher.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/http/http_stream_factory_impl.h" 5 #include "net/http/http_stream_factory_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 class MockHttpStreamFactoryImplForPreconnect : public HttpStreamFactoryImpl { 135 class MockHttpStreamFactoryImplForPreconnect : public HttpStreamFactoryImpl {
136 public: 136 public:
137 MockHttpStreamFactoryImplForPreconnect(HttpNetworkSession* session) 137 MockHttpStreamFactoryImplForPreconnect(HttpNetworkSession* session)
138 : HttpStreamFactoryImpl(session, false), 138 : HttpStreamFactoryImpl(session, false),
139 preconnect_done_(false), 139 preconnect_done_(false),
140 waiting_for_preconnect_(false) {} 140 waiting_for_preconnect_(false) {}
141 141
142 void WaitForPreconnects() { 142 void WaitForPreconnects() {
143 while (!preconnect_done_) { 143 while (!preconnect_done_) {
144 waiting_for_preconnect_ = true; 144 waiting_for_preconnect_ = true;
145 base::MessageLoop::current()->Run(); 145 base::RunLoop().Run();
146 waiting_for_preconnect_ = false; 146 waiting_for_preconnect_ = false;
147 } 147 }
148 } 148 }
149 149
150 private: 150 private:
151 // HttpStreamFactoryImpl methods. 151 // HttpStreamFactoryImpl methods.
152 void OnPreconnectsCompleteInternal() override { 152 void OnPreconnectsCompleteInternal() override {
153 preconnect_done_ = true; 153 preconnect_done_ = true;
154 if (waiting_for_preconnect_) 154 if (waiting_for_preconnect_)
155 base::MessageLoop::current()->QuitWhenIdle(); 155 base::MessageLoop::current()->QuitWhenIdle();
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info, 226 void OnHttpsProxyTunnelResponse(const HttpResponseInfo& response_info,
227 const SSLConfig& used_ssl_config, 227 const SSLConfig& used_ssl_config,
228 const ProxyInfo& used_proxy_info, 228 const ProxyInfo& used_proxy_info,
229 HttpStream* stream) override {} 229 HttpStream* stream) override {}
230 230
231 void OnQuicBroken() override {} 231 void OnQuicBroken() override {}
232 232
233 void WaitForStream() { 233 void WaitForStream() {
234 while (!stream_done_) { 234 while (!stream_done_) {
235 waiting_for_stream_ = true; 235 waiting_for_stream_ = true;
236 base::MessageLoop::current()->Run(); 236 base::RunLoop().Run();
237 waiting_for_stream_ = false; 237 waiting_for_stream_ = false;
238 } 238 }
239 } 239 }
240 240
241 const SSLConfig& used_ssl_config() const { 241 const SSLConfig& used_ssl_config() const {
242 return used_ssl_config_; 242 return used_ssl_config_;
243 } 243 }
244 244
245 const ProxyInfo& used_proxy_info() const { 245 const ProxyInfo& used_proxy_info() const {
246 return used_proxy_info_; 246 return used_proxy_info_;
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after
2079 session->GetTransportSocketPool( 2079 session->GetTransportSocketPool(
2080 HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); 2080 HttpNetworkSession::WEBSOCKET_SOCKET_POOL)));
2081 EXPECT_EQ(1, GetSocketPoolGroupCount( 2081 EXPECT_EQ(1, GetSocketPoolGroupCount(
2082 session->GetSSLSocketPool(HttpNetworkSession::WEBSOCKET_SOCKET_POOL))); 2082 session->GetSSLSocketPool(HttpNetworkSession::WEBSOCKET_SOCKET_POOL)));
2083 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); 2083 EXPECT_TRUE(waiter.used_proxy_info().is_direct());
2084 } 2084 }
2085 2085
2086 } // namespace 2086 } // namespace
2087 2087
2088 } // namespace net 2088 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_response_body_drainer_unittest.cc ('k') | net/proxy/mock_proxy_script_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698