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

Side by Side Diff: net/dns/mdns_client_unittest.cc

Issue 1398973003: Don't use base::MessageLoop::{Quit,QuitClosure} in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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/dns/host_resolver_impl_unittest.cc ('k') | net/http/http_response_body_drainer_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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 <queue> 5 #include <queue>
6 6
7 #include "base/location.h" 7 #include "base/location.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 517 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 base::CancelableCallback<void()> callback(base::Bind(&MDnsTest::Stop, 528 base::CancelableCallback<void()> callback(base::Bind(&MDnsTest::Stop,
529 base::Unretained(this))); 529 base::Unretained(this)));
530 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( 530 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
531 FROM_HERE, callback.callback(), time_period); 531 FROM_HERE, callback.callback(), time_period);
532 532
533 base::MessageLoop::current()->Run(); 533 base::MessageLoop::current()->Run();
534 callback.Cancel(); 534 callback.Cancel();
535 } 535 }
536 536
537 void MDnsTest::Stop() { 537 void MDnsTest::Stop() {
538 base::MessageLoop::current()->Quit(); 538 base::MessageLoop::current()->QuitWhenIdle();
539 } 539 }
540 540
541 TEST_F(MDnsTest, PassiveListeners) { 541 TEST_F(MDnsTest, PassiveListeners) {
542 StrictMock<MockListenerDelegate> delegate_privet; 542 StrictMock<MockListenerDelegate> delegate_privet;
543 StrictMock<MockListenerDelegate> delegate_printer; 543 StrictMock<MockListenerDelegate> delegate_printer;
544 544
545 PtrRecordCopyContainer record_privet; 545 PtrRecordCopyContainer record_privet;
546 PtrRecordCopyContainer record_printer; 546 PtrRecordCopyContainer record_printer;
547 547
548 scoped_ptr<MDnsListener> listener_privet = test_client_->CreateListener( 548 scoped_ptr<MDnsListener> listener_privet = test_client_->CreateListener(
(...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
1314 SendToInternal(sample_packet_, "224.0.0.251:5353", _)) 1314 SendToInternal(sample_packet_, "224.0.0.251:5353", _))
1315 .Times(0); 1315 .Times(0);
1316 // Expect call for the second IPv6 packed. 1316 // Expect call for the second IPv6 packed.
1317 EXPECT_CALL(*socket_ipv6_, 1317 EXPECT_CALL(*socket_ipv6_,
1318 SendToInternal(sample_packet_, "[ff02::fb]:5353", _)) 1318 SendToInternal(sample_packet_, "[ff02::fb]:5353", _))
1319 .WillOnce(Return(OK)); 1319 .WillOnce(Return(OK));
1320 callback.Run(OK); 1320 callback.Run(OK);
1321 } 1321 }
1322 1322
1323 } // namespace net 1323 } // namespace net
OLDNEW
« no previous file with comments | « net/dns/host_resolver_impl_unittest.cc ('k') | net/http/http_response_body_drainer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698