1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ipc/ipdl/test/cxx/TestSanity.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,63 @@ 1.4 +#ifndef mozilla__ipdltest_TestSanity_h 1.5 +#define mozilla__ipdltest_TestSanity_h 1 1.6 + 1.7 +#include "mozilla/_ipdltest/IPDLUnitTests.h" 1.8 + 1.9 +#include "mozilla/_ipdltest/PTestSanityParent.h" 1.10 +#include "mozilla/_ipdltest/PTestSanityChild.h" 1.11 + 1.12 +namespace mozilla { 1.13 +namespace _ipdltest { 1.14 + 1.15 + 1.16 +class TestSanityParent : 1.17 + public PTestSanityParent 1.18 +{ 1.19 +public: 1.20 + TestSanityParent(); 1.21 + virtual ~TestSanityParent(); 1.22 + 1.23 + static bool RunTestInProcesses() { return true; } 1.24 + static bool RunTestInThreads() { return true; } 1.25 + 1.26 + void Main(); 1.27 + 1.28 +protected: 1.29 + virtual bool RecvPong(const int& one, const float& zeroPtTwoFive, 1.30 + const uint8_t& dummy) MOZ_OVERRIDE; 1.31 + 1.32 + virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE 1.33 + { 1.34 + if (NormalShutdown != why) 1.35 + fail("unexpected destruction!"); 1.36 + passed("ok"); 1.37 + QuitParent(); 1.38 + } 1.39 +}; 1.40 + 1.41 + 1.42 +class TestSanityChild : 1.43 + public PTestSanityChild 1.44 +{ 1.45 +public: 1.46 + TestSanityChild(); 1.47 + virtual ~TestSanityChild(); 1.48 + 1.49 +protected: 1.50 + virtual bool RecvPing(const int& zero, const float& zeroPtFive, 1.51 + const int8_t& dummy) MOZ_OVERRIDE; 1.52 + 1.53 + virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE 1.54 + { 1.55 + if (NormalShutdown != why) 1.56 + fail("unexpected destruction!"); 1.57 + QuitChild(); 1.58 + } 1.59 +}; 1.60 + 1.61 + 1.62 +} // namespace _ipdltest 1.63 +} // namespace mozilla 1.64 + 1.65 + 1.66 +#endif // ifndef mozilla__ipdltest_TestSanity_h