| OLD | NEW |
| 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 "base/message_loop/message_loop.h" |
| 7 #include "ipc/ipc_message.h" | 8 #include "ipc/ipc_message.h" |
| 8 #include "ipc/ipc_sender.h" | 9 #include "ipc/ipc_sender.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 11 |
| 11 namespace IPC { | 12 namespace IPC { |
| 12 | 13 |
| 13 // static | 14 // static |
| 14 void TestChannelListener::SendOneMessage(IPC::Sender* sender, | 15 void TestChannelListener::SendOneMessage(IPC::Sender* sender, |
| 15 const char* text) { | 16 const char* text) { |
| 16 static int message_index = 0; | 17 static int message_index = 0; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 } | 54 } |
| 54 | 55 |
| 55 void TestChannelListener::SendNextMessage() { | 56 void TestChannelListener::SendNextMessage() { |
| 56 if (--messages_left_ <= 0) | 57 if (--messages_left_ <= 0) |
| 57 base::MessageLoop::current()->QuitWhenIdle(); | 58 base::MessageLoop::current()->QuitWhenIdle(); |
| 58 else | 59 else |
| 59 SendOneMessage(sender_, "Foo"); | 60 SendOneMessage(sender_, "Foo"); |
| 60 } | 61 } |
| 61 | 62 |
| 62 } | 63 } |
| OLD | NEW |