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 <stdint.h> | 5 #include <stdint.h> |
6 #include <stdio.h> | 6 #include <stdio.h> |
7 | 7 |
8 #include <limits> | 8 #include <limits> |
9 #include <sstream> | 9 #include <sstream> |
10 #include <string> | 10 #include <string> |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 252 |
253 IPC::Message* last_msg_; | 253 IPC::Message* last_msg_; |
254 }; | 254 }; |
255 | 255 |
256 // Runs the fuzzing server child mode. Returns when the preset number of | 256 // Runs the fuzzing server child mode. Returns when the preset number of |
257 // messages have been received. | 257 // messages have been received. |
258 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(FuzzServerClient) { | 258 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(FuzzServerClient) { |
259 base::MessageLoopForIO main_message_loop; | 259 base::MessageLoopForIO main_message_loop; |
260 FuzzerServerListener listener; | 260 FuzzerServerListener listener; |
261 scoped_ptr<IPC::Channel> channel(IPC::Channel::CreateClient( | 261 scoped_ptr<IPC::Channel> channel(IPC::Channel::CreateClient( |
262 IPCTestBase::GetChannelName("FuzzServerClient"), &listener, nullptr)); | 262 IPCTestBase::GetChannelName("FuzzServerClient"), &listener)); |
263 CHECK(channel->Connect()); | 263 CHECK(channel->Connect()); |
264 listener.Init(channel.get()); | 264 listener.Init(channel.get()); |
265 base::MessageLoop::current()->Run(); | 265 base::MessageLoop::current()->Run(); |
266 return 0; | 266 return 0; |
267 } | 267 } |
268 | 268 |
269 class IPCFuzzingTest : public IPCTestBase { | 269 class IPCFuzzingTest : public IPCTestBase { |
270 }; | 270 }; |
271 | 271 |
272 #if defined(OS_ANDROID) | 272 #if defined(OS_ANDROID) |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 // thrown out of sync by the extra argument. | 364 // thrown out of sync by the extra argument. |
365 msg = new MsgClassIS(3, base::ASCIIToUTF16("expect three")); | 365 msg = new MsgClassIS(3, base::ASCIIToUTF16("expect three")); |
366 sender()->Send(msg); | 366 sender()->Send(msg); |
367 EXPECT_TRUE(listener.ExpectMessage(3, MsgClassIS::ID)); | 367 EXPECT_TRUE(listener.ExpectMessage(3, MsgClassIS::ID)); |
368 | 368 |
369 EXPECT_TRUE(WaitForClientShutdown()); | 369 EXPECT_TRUE(WaitForClientShutdown()); |
370 DestroyChannel(); | 370 DestroyChannel(); |
371 } | 371 } |
372 | 372 |
373 } // namespace | 373 } // namespace |
OLD | NEW |