Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef IPC_IPC_TESTS_H_ | 5 #ifndef IPC_IPC_TESTS_H_ |
| 6 #define IPC_IPC_TESTS_H_ | 6 #define IPC_IPC_TESTS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/test/multiprocess_test.h" | 9 #include "base/test/multiprocess_test.h" |
| 10 #include "base/process.h" | 10 #include "base/process.h" |
| 11 | 11 |
| 12 #define MULTIPROCESS_IPC_TEST_MAIN(test_main) \ | |
|
jeremy
2012/06/13 20:46:28
Can you add a comment that explains when a test ne
Jay Civelli
2012/06/22 23:28:29
Done.
| |
| 13 MULTIPROCESS_TEST_MAIN_WITH_SETUP(test_main, MultiProcessTestIPCSetUp) | |
| 14 | |
| 12 // This unit test uses 3 types of child processes, a regular pipe client, | 15 // This unit test uses 3 types of child processes, a regular pipe client, |
| 13 // a client reflector and a IPC server used for fuzzing tests. | 16 // a client reflector and a IPC server used for fuzzing tests. |
| 14 enum ChildType { | 17 enum ChildType { |
| 15 TEST_CLIENT, | 18 TEST_CLIENT, |
| 16 TEST_DESCRIPTOR_CLIENT, | 19 TEST_DESCRIPTOR_CLIENT, |
| 17 TEST_DESCRIPTOR_CLIENT_SANDBOXED, | 20 TEST_DESCRIPTOR_CLIENT_SANDBOXED, |
| 18 TEST_REFLECTOR, | 21 TEST_REFLECTOR, |
| 19 FUZZER_SERVER, | 22 FUZZER_SERVER, |
| 20 SYNC_SOCKET_SERVER | 23 SYNC_SOCKET_SERVER |
| 21 }; | 24 }; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 39 virtual void SetUp() OVERRIDE; | 42 virtual void SetUp() OVERRIDE; |
| 40 virtual void TearDown() OVERRIDE; | 43 virtual void TearDown() OVERRIDE; |
| 41 | 44 |
| 42 // Spawns a child process of the specified type | 45 // Spawns a child process of the specified type |
| 43 base::ProcessHandle SpawnChild(ChildType child_type, IPC::Channel* channel); | 46 base::ProcessHandle SpawnChild(ChildType child_type, IPC::Channel* channel); |
| 44 | 47 |
| 45 // Created around each test instantiation. | 48 // Created around each test instantiation. |
| 46 MessageLoopForIO* message_loop_; | 49 MessageLoopForIO* message_loop_; |
| 47 }; | 50 }; |
| 48 | 51 |
| 52 // Setup function used by MULTIPROCESS_IPC_TEST_MAIN. | |
| 53 // Registers the IPC channel as a global descriptor on Posix. | |
|
jeremy
2012/06/13 20:46:28
Can you expand this comment, esp. it's not clear w
Jay Civelli
2012/06/22 23:28:29
Done.
| |
| 54 int MultiProcessTestIPCSetUp(); | |
| 55 | |
| 49 #endif // IPC_IPC_TESTS_H_ | 56 #endif // IPC_IPC_TESTS_H_ |
| OLD | NEW |