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

Unified Diff: ipc/sync_socket_unittest.cc

Issue 2451953003: Change most IPC tests to use ChannelMojo. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/ipc_test_base.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/sync_socket_unittest.cc
diff --git a/ipc/sync_socket_unittest.cc b/ipc/sync_socket_unittest.cc
index 07a920cc70c48d886b40bcc358087db6cbefeb7d..67253aa624cafd29d36604ecad5eea3d1eb0bfb6 100644
--- a/ipc/sync_socket_unittest.cc
+++ b/ipc/sync_socket_unittest.cc
@@ -109,16 +109,12 @@ class SyncSocketServerListener : public IPC::Listener {
// Runs the fuzzing server child mode. Returns when the preset number of
// messages have been received.
-MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SyncSocketServerClient) {
- base::MessageLoopForIO main_message_loop;
+DEFINE_IPC_CHANNEL_MOJO_TEST_CLIENT(SyncSocketServerClient) {
SyncSocketServerListener listener;
- std::unique_ptr<IPC::Channel> channel(IPC::Channel::CreateClient(
- IPCTestBase::GetChannelName("SyncSocketServerClient"), &listener,
- main_message_loop.task_runner()));
- EXPECT_TRUE(channel->Connect());
- listener.Init(channel.get());
+ Connect(&listener);
+ listener.Init(channel());
base::RunLoop().Run();
- return 0;
+ Close();
}
// The SyncSocket client listener only processes one sort of message,
@@ -166,15 +162,13 @@ class SyncSocketClientListener : public IPC::Listener {
DISALLOW_COPY_AND_ASSIGN(SyncSocketClientListener);
};
-class SyncSocketTest : public IPCTestBase {
-};
+using SyncSocketTest = IPCChannelMojoTestBase;
TEST_F(SyncSocketTest, SanityTest) {
Init("SyncSocketServerClient");
SyncSocketClientListener listener;
CreateChannel(&listener);
- ASSERT_TRUE(StartClient());
// Create a pair of SyncSockets.
base::SyncSocket pair[2];
base::SyncSocket::CreatePair(&pair[0], &pair[1]);
« no previous file with comments | « ipc/ipc_test_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698