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

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

Issue 17567007: Made MessagePump a non-thread safe class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved incoming_queue_ to MessageLoopProxyImpl Created 7 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 | Annotate | Revision Log
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/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "net/base/rand_callback.h" 9 #include "net/base/rand_callback.h"
10 #include "net/base/test_completion_callback.h" 10 #include "net/base/test_completion_callback.h"
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 } 345 }
346 346
347 MDnsTest::~MDnsTest() { 347 MDnsTest::~MDnsTest() {
348 } 348 }
349 349
350 void MDnsTest::TearDown() { 350 void MDnsTest::TearDown() {
351 base::MessageLoop::current()->RunUntilIdle(); 351 base::MessageLoop::current()->RunUntilIdle();
352 352
353 ASSERT_FALSE(test_client_->IsListeningForTests()); 353 ASSERT_FALSE(test_client_->IsListeningForTests());
354 354
355 base::MessageLoop::current()->AssertIdle(); 355 EXPECT_TRUE(base::MessageLoop::current()->IsIdleForTest());
356 } 356 }
357 357
358 void MDnsTest::SimulatePacketReceive(const char* packet, unsigned size) { 358 void MDnsTest::SimulatePacketReceive(const char* packet, unsigned size) {
359 socket_factory_->SimulateReceive(packet, size); 359 socket_factory_->SimulateReceive(packet, size);
360 } 360 }
361 361
362 void MDnsTest::ExpectPacket( 362 void MDnsTest::ExpectPacket(
363 const char* packet, 363 const char* packet,
364 unsigned size) { 364 unsigned size) {
365 EXPECT_CALL(*socket_factory_, OnSendTo(std::string(packet, size))) 365 EXPECT_CALL(*socket_factory_, OnSendTo(std::string(packet, size)))
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 989
990 ASSERT_TRUE(InitConnection()); 990 ASSERT_TRUE(InitConnection());
991 991
992 EXPECT_CALL(delegate_, OnConnectionError(ERR_SOCKET_NOT_CONNECTED)); 992 EXPECT_CALL(delegate_, OnConnectionError(ERR_SOCKET_NOT_CONNECTED));
993 callback.Run(ERR_SOCKET_NOT_CONNECTED); 993 callback.Run(ERR_SOCKET_NOT_CONNECTED);
994 } 994 }
995 995
996 } // namespace 996 } // namespace
997 997
998 } // namespace net 998 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698