| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 | 7 |
| 8 #include "base/multiprocess_test.h" | 8 #include "base/multiprocess_test.h" |
| 9 #include "base/process.h" | 9 #include "base/process.h" |
| 10 | 10 |
| 11 // This unit test uses 3 types of child processes, a regular pipe client, | 11 // This unit test uses 3 types of child processes, a regular pipe client, |
| 12 // a client reflector and a IPC server used for fuzzing tests. | 12 // a client reflector and a IPC server used for fuzzing tests. |
| 13 enum ChildType { | 13 enum ChildType { |
| 14 TEST_CLIENT, | 14 TEST_CLIENT, |
| 15 TEST_DESCRIPTOR_CLIENT, | 15 TEST_DESCRIPTOR_CLIENT, |
| 16 TEST_DESCRIPTOR_CLIENT_SANDBOXED, | 16 TEST_DESCRIPTOR_CLIENT_SANDBOXED, |
| 17 TEST_REFLECTOR, | 17 TEST_REFLECTOR, |
| 18 FUZZER_SERVER | 18 FUZZER_SERVER, |
| 19 SYNC_SOCKET_SERVER |
| 19 }; | 20 }; |
| 20 | 21 |
| 21 // The different channel names for the child processes. | 22 // The different channel names for the child processes. |
| 22 extern const char kTestClientChannel[]; | 23 extern const char kTestClientChannel[]; |
| 23 extern const char kReflectorChannel[]; | 24 extern const char kReflectorChannel[]; |
| 24 extern const char kFuzzerChannel[]; | 25 extern const char kFuzzerChannel[]; |
| 26 extern const char kSyncSocketChannel[]; |
| 25 | 27 |
| 26 class MessageLoopForIO; | 28 class MessageLoopForIO; |
| 27 namespace IPC { | 29 namespace IPC { |
| 28 class Channel; | 30 class Channel; |
| 29 } // namespace IPC | 31 } // namespace IPC |
| 30 | 32 |
| 31 //Base class to facilitate Spawning IPC Client processes. | 33 //Base class to facilitate Spawning IPC Client processes. |
| 32 class IPCChannelTest : public MultiProcessTest { | 34 class IPCChannelTest : public MultiProcessTest { |
| 33 protected: | 35 protected: |
| 34 | 36 |
| 35 // Create a new MessageLoopForIO For each test. | 37 // Create a new MessageLoopForIO For each test. |
| 36 virtual void SetUp(); | 38 virtual void SetUp(); |
| 37 virtual void TearDown(); | 39 virtual void TearDown(); |
| 38 | 40 |
| 39 // Spawns a child process of the specified type | 41 // Spawns a child process of the specified type |
| 40 base::ProcessHandle SpawnChild(ChildType child_type, | 42 base::ProcessHandle SpawnChild(ChildType child_type, |
| 41 IPC::Channel *channel); | 43 IPC::Channel *channel); |
| 42 | 44 |
| 43 // Created around each test instantiation. | 45 // Created around each test instantiation. |
| 44 MessageLoopForIO *message_loop_; | 46 MessageLoopForIO *message_loop_; |
| 45 }; | 47 }; |
| 46 | 48 |
| 47 #endif // IPC_IPC_TESTS_H__ | 49 #endif // IPC_IPC_TESTS_H__ |
| OLD | NEW |