ipc_sync_message_unittest.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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
  3. // found in the LICENSE file.
  4. // no-include-guard-because-multiply-included
  5. // Multiply-included message file, hence no include guard here.
  6. #include <string>
  7. #include "ipc/ipc_message_macros.h"
  8. #include "ipc/ipc_message_start.h"
  9. #define IPC_MESSAGE_START TestMsgStart
  10. IPC_SYNC_MESSAGE_CONTROL0_0(SyncChannelTestMsg_NoArgs)
  11. IPC_SYNC_MESSAGE_CONTROL0_1(SyncChannelTestMsg_AnswerToLife,
  12. int /* answer */)
  13. IPC_SYNC_MESSAGE_CONTROL1_1(SyncChannelTestMsg_Double,
  14. int /* in */,
  15. int /* out */)
  16. IPC_SYNC_MESSAGE_CONTROL0_1(SyncChannelNestedTestMsg_String,
  17. std::string)
  18. // out1 is false
  19. IPC_SYNC_MESSAGE_CONTROL0_1(Msg_C_0_1, bool)
  20. // out1 is true, out2 is 2
  21. IPC_SYNC_MESSAGE_CONTROL0_2(Msg_C_0_2, bool, int)
  22. // out1 is false, out2 is 3, out3 is "0_3"
  23. IPC_SYNC_MESSAGE_CONTROL0_3(Msg_C_0_3, bool, int, std::string)
  24. // in1 must be 1, out1 is true
  25. IPC_SYNC_MESSAGE_CONTROL1_1(Msg_C_1_1, int, bool)
  26. // in1 must be false, out1 is true, out2 is 12
  27. IPC_SYNC_MESSAGE_CONTROL1_2(Msg_C_1_2, bool, bool, int)
  28. // in1 must be 3, out1 is "1_3", out2 is 13, out3 is false
  29. IPC_SYNC_MESSAGE_CONTROL1_3(Msg_C_1_3, int, std::string, int, bool)
  30. // in1 must be 1, in2 must be false, out1 is true
  31. IPC_SYNC_MESSAGE_CONTROL2_1(Msg_C_2_1, int, bool, bool)
  32. // in1 must be false, in2 must be 2, out1 is true, out2 is 22
  33. IPC_SYNC_MESSAGE_CONTROL2_2(Msg_C_2_2, bool, int, bool, int)
  34. // in1 must be 3, in2 must be true, out1 is "2_3", out2 is 23, out3 is false
  35. IPC_SYNC_MESSAGE_CONTROL2_3(Msg_C_2_3, int, bool, std::string, int, bool)
  36. // in1 must be 1, in2 must be false, in3 must be "3_1", out1 is true
  37. IPC_SYNC_MESSAGE_CONTROL3_1(Msg_C_3_1, int, bool, std::string, bool)
  38. // in1 must be "3_3", in2 must be false, in3 must be 2, out1 is true, out2 is
  39. // 32
  40. IPC_SYNC_MESSAGE_CONTROL3_2(Msg_C_3_2, std::string, bool, int, bool, int)
  41. // in1 must be 3, in2 must be "3_3", in3 must be true, out1 is "3_3", out2 is
  42. // 33, out3 is false
  43. IPC_SYNC_MESSAGE_CONTROL3_3(Msg_C_3_3, int, std::string, bool, std::string,
  44. int, bool)
  45. // in1 must be true, in2 must be 3, in3 must be "3_4", out1 is 34, out2 is
  46. // true, out3 is "3_4", out3 is false
  47. IPC_SYNC_MESSAGE_CONTROL3_4(Msg_C_3_4, bool, int, std::string, int, bool,
  48. std::string, bool)
  49. // NOTE: routed messages are just a copy of the above...
  50. // out1 is false
  51. IPC_SYNC_MESSAGE_ROUTED0_1(Msg_R_0_1, bool)
  52. // out1 is true, out2 is 2
  53. IPC_SYNC_MESSAGE_ROUTED0_2(Msg_R_0_2, bool, int)
  54. // out1 is false, out2 is 3, out3 is "0_3"
  55. IPC_SYNC_MESSAGE_ROUTED0_3(Msg_R_0_3, bool, int, std::string)
  56. // in1 must be 1, out1 is true
  57. IPC_SYNC_MESSAGE_ROUTED1_1(Msg_R_1_1, int, bool)
  58. // in1 must be false, out1 is true, out2 is 12
  59. IPC_SYNC_MESSAGE_ROUTED1_2(Msg_R_1_2, bool, bool, int)
  60. // in1 must be 3, out1 is "1_3", out2 is 13, out3 is false
  61. IPC_SYNC_MESSAGE_ROUTED1_3(Msg_R_1_3, int, std::string, int, bool)
  62. // in1 must be 1, in2 must be false, out1 is true
  63. IPC_SYNC_MESSAGE_ROUTED2_1(Msg_R_2_1, int, bool, bool)
  64. // in1 must be false, in2 must be 2, out1 is true, out2 is 22
  65. IPC_SYNC_MESSAGE_ROUTED2_2(Msg_R_2_2, bool, int, bool, int)
  66. // in1 must be 3, in2 must be true, out1 is "2_3", out2 is 23, out3 is false
  67. IPC_SYNC_MESSAGE_ROUTED2_3(Msg_R_2_3, int, bool, std::string, int, bool)
  68. // in1 must be 1, in2 must be false, in3 must be "3_1", out1 is true
  69. IPC_SYNC_MESSAGE_ROUTED3_1(Msg_R_3_1, int, bool, std::string, bool)
  70. // in1 must be "3_3", in2 must be false, in3 must be 2, out1 is true, out2
  71. // is 32
  72. IPC_SYNC_MESSAGE_ROUTED3_2(Msg_R_3_2, std::string, bool, int, bool, int)
  73. // in1 must be 3, in2 must be "3_3", in3 must be true, out1 is "3_3", out2 is
  74. // 33, out3 is false
  75. IPC_SYNC_MESSAGE_ROUTED3_3(Msg_R_3_3, int, std::string, bool, std::string,
  76. int, bool)
  77. // in1 must be true, in2 must be 3, in3 must be "3_4", out1 is 34, out2 is
  78. // true, out3 is "3_4", out4 is false
  79. IPC_SYNC_MESSAGE_ROUTED3_4(Msg_R_3_4, bool, int, std::string, int, bool,
  80. std::string, bool)
  81. IPC_MESSAGE_CONTROL1(SyncChannelTestMsg_Ping, int)
  82. IPC_SYNC_MESSAGE_CONTROL1_1(SyncChannelTestMsg_PingTTL, int, int)
  83. IPC_SYNC_MESSAGE_CONTROL0_0(SyncChannelTestMsg_Done)
  84. // Messages for ReentrantReply test.
  85. IPC_SYNC_MESSAGE_CONTROL0_0(SyncChannelTestMsg_Reentrant1)
  86. IPC_SYNC_MESSAGE_CONTROL0_0(SyncChannelTestMsg_Reentrant2)
  87. IPC_SYNC_MESSAGE_CONTROL0_0(SyncChannelTestMsg_Reentrant3)