ipc_channel_proxy_unittest_messages.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright 2014 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. #include "ipc/ipc_message_macros.h"
  5. #include "ipc/ipc_message_start.h"
  6. // Singly-included section for enums and custom IPC traits.
  7. #ifndef IPC_IPC_CHANNEL_PROXY_UNITTEST_MESSAGES_H_
  8. #define IPC_IPC_CHANNEL_PROXY_UNITTEST_MESSAGES_H_
  9. class BadType {
  10. public:
  11. BadType() {}
  12. };
  13. namespace IPC {
  14. template <>
  15. struct ParamTraits<BadType> {
  16. static void Write(base::Pickle* m, const BadType& p) {}
  17. static bool Read(const base::Pickle* m,
  18. base::PickleIterator* iter,
  19. BadType* r) {
  20. return false;
  21. }
  22. static void Log(const BadType& p, std::string* l) {}
  23. };
  24. }
  25. #endif // IPC_IPC_CHANNEL_PROXY_UNITTEST_MESSAGES_H_
  26. #undef IPC_MESSAGE_START
  27. #define IPC_MESSAGE_START TestMsgStart
  28. IPC_MESSAGE_CONTROL0(TestMsg_Bounce)
  29. IPC_MESSAGE_CONTROL0(TestMsg_SendBadMessage)
  30. IPC_MESSAGE_CONTROL1(TestMsg_BadMessage, BadType)
  31. #undef IPC_MESSAGE_START
  32. #define IPC_MESSAGE_START AutomationMsgStart
  33. IPC_MESSAGE_CONTROL0(AutomationMsg_Bounce)
  34. #undef IPC_MESSAGE_START
  35. #define IPC_MESSAGE_START WorkerMsgStart
  36. IPC_MESSAGE_CONTROL0(WorkerMsg_Bounce)
  37. IPC_MESSAGE_CONTROL0(WorkerMsg_Quit)