| OLD | NEW |
| 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 "base/run_loop.h" |
| 5 #include "build/build_config.h" | 6 #include "build/build_config.h" |
| 6 | 7 |
| 7 #if defined(OS_WIN) | 8 #if defined(OS_WIN) |
| 8 #include <windows.h> | 9 #include <windows.h> |
| 9 #endif | 10 #endif |
| 10 | 11 |
| 11 #include <stdint.h> | 12 #include <stdint.h> |
| 12 | 13 |
| 13 #include <memory> | 14 #include <memory> |
| 14 #include <string> | 15 #include <string> |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 CloseHandle(pipe); // The channel duplicates the handle. | 72 CloseHandle(pipe); // The channel duplicates the handle. |
| 72 listener.Init(sender()); | 73 listener.Init(sender()); |
| 73 | 74 |
| 74 // Connect to channel and start client. | 75 // Connect to channel and start client. |
| 75 ASSERT_TRUE(ConnectChannel()); | 76 ASSERT_TRUE(ConnectChannel()); |
| 76 ASSERT_TRUE(StartClient()); | 77 ASSERT_TRUE(StartClient()); |
| 77 | 78 |
| 78 IPC::TestChannelListener::SendOneMessage(sender(), "hello from parent"); | 79 IPC::TestChannelListener::SendOneMessage(sender(), "hello from parent"); |
| 79 | 80 |
| 80 // Run message loop. | 81 // Run message loop. |
| 81 base::MessageLoop::current()->Run(); | 82 base::RunLoop().Run(); |
| 82 | 83 |
| 83 // Close the channel so the client's OnChannelError() gets fired. | 84 // Close the channel so the client's OnChannelError() gets fired. |
| 84 channel()->Close(); | 85 channel()->Close(); |
| 85 | 86 |
| 86 EXPECT_TRUE(WaitForClientShutdown()); | 87 EXPECT_TRUE(WaitForClientShutdown()); |
| 87 DestroyChannel(); | 88 DestroyChannel(); |
| 88 } | 89 } |
| 89 #endif // defined (OS_WIN) | 90 #endif // defined (OS_WIN) |
| 90 | 91 |
| 91 TEST_F(IPCChannelTest, ChannelProxyTest) { | 92 TEST_F(IPCChannelTest, ChannelProxyTest) { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 main_message_loop.task_runner())); | 166 main_message_loop.task_runner())); |
| 166 CHECK(channel->Connect()); | 167 CHECK(channel->Connect()); |
| 167 listener.Init(channel.get()); | 168 listener.Init(channel.get()); |
| 168 IPC::TestChannelListener::SendOneMessage(channel.get(), "hello from child"); | 169 IPC::TestChannelListener::SendOneMessage(channel.get(), "hello from child"); |
| 169 | 170 |
| 170 base::RunLoop().Run(); | 171 base::RunLoop().Run(); |
| 171 return 0; | 172 return 0; |
| 172 } | 173 } |
| 173 | 174 |
| 174 } // namespace | 175 } // namespace |
| OLD | NEW |