Index: ipc/ipc_fuzzing_tests.cc |
diff --git a/ipc/ipc_fuzzing_tests.cc b/ipc/ipc_fuzzing_tests.cc |
index 2cf58950e3d8bc6287b82b961ddf052ff6284aff..8e385bc34fe828bca88d781a26628dab6e7da953 100644 |
--- a/ipc/ipc_fuzzing_tests.cc |
+++ b/ipc/ipc_fuzzing_tests.cc |
@@ -258,20 +258,15 @@ class FuzzerClientListener : public SimpleListener { |
// Runs the fuzzing server child mode. Returns when the preset number of |
// messages have been received. |
-MULTIPROCESS_IPC_TEST_CLIENT_MAIN(FuzzServerClient) { |
- base::MessageLoopForIO main_message_loop; |
+DEFINE_IPC_CHANNEL_MOJO_TEST_CLIENT(FuzzServerClient) { |
FuzzerServerListener listener; |
- std::unique_ptr<IPC::Channel> channel(IPC::Channel::CreateClient( |
- IPCTestBase::GetChannelName("FuzzServerClient"), &listener, |
- main_message_loop.task_runner())); |
- CHECK(channel->Connect()); |
- listener.Init(channel.get()); |
+ Connect(&listener); |
+ listener.Init(channel()); |
base::RunLoop().Run(); |
- return 0; |
+ Close(); |
} |
-class IPCFuzzingTest : public IPCTestBase { |
-}; |
+using IPCFuzzingTest = IPCChannelMojoTestBase; |
// This test makes sure that the FuzzerClientListener and FuzzerServerListener |
// are working properly by generating two well formed IPC calls. |
@@ -282,7 +277,6 @@ TEST_F(IPCFuzzingTest, SanityTest) { |
CreateChannel(&listener); |
listener.Init(channel()); |
ASSERT_TRUE(ConnectChannel()); |
- ASSERT_TRUE(StartClient()); |
IPC::Message* msg = NULL; |
int value = 43; |
@@ -299,10 +293,8 @@ TEST_F(IPCFuzzingTest, SanityTest) { |
} |
// This test uses a payload that is smaller than expected. This generates an |
-// error while unpacking the IPC buffer which in debug trigger an assertion and |
-// in release is ignored (!). Right after we generate another valid IPC to make |
-// sure framing is working properly. |
-#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON) |
+// error while unpacking the IPC buffer. Right after we generate another valid |
+// IPC to make sure framing is working properly. |
TEST_F(IPCFuzzingTest, MsgBadPayloadShort) { |
Init("FuzzServerClient"); |
@@ -310,7 +302,6 @@ TEST_F(IPCFuzzingTest, MsgBadPayloadShort) { |
CreateChannel(&listener); |
listener.Init(channel()); |
ASSERT_TRUE(ConnectChannel()); |
- ASSERT_TRUE(StartClient()); |
IPC::Message* msg = new IPC::Message(MSG_ROUTING_CONTROL, MsgClassIS::ID, |
IPC::Message::PRIORITY_NORMAL); |
@@ -325,7 +316,6 @@ TEST_F(IPCFuzzingTest, MsgBadPayloadShort) { |
EXPECT_TRUE(WaitForClientShutdown()); |
DestroyChannel(); |
} |
-#endif |
// This test uses a payload that has too many arguments, but so the payload size |
// is big enough so the unpacking routine does not generate an error as in the |
@@ -338,7 +328,6 @@ TEST_F(IPCFuzzingTest, MsgBadPayloadArgs) { |
CreateChannel(&listener); |
listener.Init(channel()); |
ASSERT_TRUE(ConnectChannel()); |
- ASSERT_TRUE(StartClient()); |
IPC::Message* msg = new IPC::Message(MSG_ROUTING_CONTROL, MsgClassSI::ID, |
IPC::Message::PRIORITY_NORMAL); |