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

Side by Side Diff: net/quic/quic_stream_factory_test.cc

Issue 2053133002: Remove MessageLoop::current()->RunUntilIdle() 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
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/quic/quic_stream_factory.h" 5 #include "net/quic/quic_stream_factory.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 8
9 #include "base/run_loop.h" 9 #include "base/run_loop.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 void GetCurrentConnectedNetworks(NetworkList* network_list) const override { 205 void GetCurrentConnectedNetworks(NetworkList* network_list) const override {
206 network_list->clear(); 206 network_list->clear();
207 *network_list = connected_networks_; 207 *network_list = connected_networks_;
208 } 208 }
209 209
210 void NotifyNetworkSoonToDisconnect( 210 void NotifyNetworkSoonToDisconnect(
211 NetworkChangeNotifier::NetworkHandle network) { 211 NetworkChangeNotifier::NetworkHandle network) {
212 NetworkChangeNotifier::NotifyObserversOfSpecificNetworkChange( 212 NetworkChangeNotifier::NotifyObserversOfSpecificNetworkChange(
213 NetworkChangeNotifier::SOON_TO_DISCONNECT, network); 213 NetworkChangeNotifier::SOON_TO_DISCONNECT, network);
214 // Spin the message loop so the notification is delivered. 214 // Spin the message loop so the notification is delivered.
215 base::MessageLoop::current()->RunUntilIdle(); 215 base::RunLoop().RunUntilIdle();
216 } 216 }
217 217
218 void NotifyNetworkDisconnected(NetworkChangeNotifier::NetworkHandle network) { 218 void NotifyNetworkDisconnected(NetworkChangeNotifier::NetworkHandle network) {
219 NetworkChangeNotifier::NotifyObserversOfSpecificNetworkChange( 219 NetworkChangeNotifier::NotifyObserversOfSpecificNetworkChange(
220 NetworkChangeNotifier::DISCONNECTED, network); 220 NetworkChangeNotifier::DISCONNECTED, network);
221 // Spin the message loop so the notification is delivered. 221 // Spin the message loop so the notification is delivered.
222 base::MessageLoop::current()->RunUntilIdle(); 222 base::RunLoop().RunUntilIdle();
223 } 223 }
224 224
225 private: 225 private:
226 bool force_network_handles_supported_; 226 bool force_network_handles_supported_;
227 NetworkChangeNotifier::NetworkList connected_networks_; 227 NetworkChangeNotifier::NetworkList connected_networks_;
228 }; 228 };
229 229
230 // Class to replace existing NetworkChangeNotifier singleton with a 230 // Class to replace existing NetworkChangeNotifier singleton with a
231 // MockNetworkChangeNotifier for a test. To use, simply create a 231 // MockNetworkChangeNotifier for a test. To use, simply create a
232 // ScopedMockNetworkChangeNotifier object in the test. 232 // ScopedMockNetworkChangeNotifier object in the test.
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 EXPECT_TRUE(test_cert.get()); 434 EXPECT_TRUE(test_cert.get());
435 ProofVerifyDetailsChromium verify_details; 435 ProofVerifyDetailsChromium verify_details;
436 verify_details.cert_verify_result.verified_cert = test_cert; 436 verify_details.cert_verify_result.verified_cert = test_cert;
437 verify_details.cert_verify_result.is_issued_by_known_root = true; 437 verify_details.cert_verify_result.is_issued_by_known_root = true;
438 return verify_details; 438 return verify_details;
439 } 439 }
440 440
441 void NotifyIPAddressChanged() { 441 void NotifyIPAddressChanged() {
442 NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(); 442 NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests();
443 // Spin the message loop so the notification is delivered. 443 // Spin the message loop so the notification is delivered.
444 base::MessageLoop::current()->RunUntilIdle(); 444 base::RunLoop().RunUntilIdle();
445 } 445 }
446 446
447 std::unique_ptr<QuicEncryptedPacket> ConstructGetRequestPacket( 447 std::unique_ptr<QuicEncryptedPacket> ConstructGetRequestPacket(
448 QuicPacketNumber packet_number, 448 QuicPacketNumber packet_number,
449 QuicStreamId stream_id, 449 QuicStreamId stream_id,
450 bool should_include_version, 450 bool should_include_version,
451 bool fin) { 451 bool fin) {
452 SpdyHeaderBlock headers = 452 SpdyHeaderBlock headers =
453 client_maker_.GetRequestHeaders("GET", "https", "/"); 453 client_maker_.GetRequestHeaders("GET", "https", "/");
454 SpdyPriority priority = 454 SpdyPriority priority =
(...skipping 3881 matching lines...) Expand 10 before | Expand all | Expand 10 after
4336 EXPECT_NE(session1, session2); 4336 EXPECT_NE(session1, session2);
4337 4337
4338 EXPECT_EQ(QuicServerId(origin1_, privacy_mode_), session1->server_id()); 4338 EXPECT_EQ(QuicServerId(origin1_, privacy_mode_), session1->server_id());
4339 EXPECT_EQ(QuicServerId(origin2_, privacy_mode_), session2->server_id()); 4339 EXPECT_EQ(QuicServerId(origin2_, privacy_mode_), session2->server_id());
4340 4340
4341 EXPECT_TRUE(AllDataConsumed()); 4341 EXPECT_TRUE(AllDataConsumed());
4342 } 4342 }
4343 4343
4344 } // namespace test 4344 } // namespace test
4345 } // namespace net 4345 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_network_transaction_unittest.cc ('k') | net/socket/sequenced_socket_data_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698