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

Side by Side Diff: ipc/ipc_test_channel_listener.cc

Issue 1389163008: Don't use base::MessageLoop::{Quit,QuitClosure} in extensions/, ipc/ (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 | « ipc/ipc_send_fds_test.cc ('k') | ipc/ipc_test_sink.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ipc/ipc_test_channel_listener.h" 5 #include "ipc/ipc_test_channel_listener.h"
6 6
7 #include "ipc/ipc_message.h" 7 #include "ipc/ipc_message.h"
8 #include "ipc/ipc_sender.h" 8 #include "ipc/ipc_sender.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 EXPECT_TRUE(iter.ReadString(&big_string)); 42 EXPECT_TRUE(iter.ReadString(&big_string));
43 EXPECT_EQ(kLongMessageStringNumBytes - 1, big_string.length()); 43 EXPECT_EQ(kLongMessageStringNumBytes - 1, big_string.length());
44 44
45 SendNextMessage(); 45 SendNextMessage();
46 return true; 46 return true;
47 } 47 }
48 48
49 void TestChannelListener::OnChannelError() { 49 void TestChannelListener::OnChannelError() {
50 // There is a race when closing the channel so the last message may be lost. 50 // There is a race when closing the channel so the last message may be lost.
51 EXPECT_LE(messages_left_, 1); 51 EXPECT_LE(messages_left_, 1);
52 base::MessageLoop::current()->Quit(); 52 base::MessageLoop::current()->QuitWhenIdle();
53 } 53 }
54 54
55 void TestChannelListener::SendNextMessage() { 55 void TestChannelListener::SendNextMessage() {
56 if (--messages_left_ <= 0) 56 if (--messages_left_ <= 0)
57 base::MessageLoop::current()->Quit(); 57 base::MessageLoop::current()->QuitWhenIdle();
58 else 58 else
59 SendOneMessage(sender_, "Foo"); 59 SendOneMessage(sender_, "Foo");
60 } 60 }
61 61
62 } 62 }
OLDNEW
« no previous file with comments | « ipc/ipc_send_fds_test.cc ('k') | ipc/ipc_test_sink.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698