1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ipc/ipdl/test/cxx/TestUrgency.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,78 @@ 1.4 +#ifndef mozilla__ipdltest_TestUrgency_h 1.5 +#define mozilla__ipdltest_TestUrgency_h 1 1.6 + 1.7 +#include "mozilla/_ipdltest/IPDLUnitTests.h" 1.8 + 1.9 +#include "mozilla/_ipdltest/PTestUrgencyParent.h" 1.10 +#include "mozilla/_ipdltest/PTestUrgencyChild.h" 1.11 + 1.12 +namespace mozilla { 1.13 +namespace _ipdltest { 1.14 + 1.15 + 1.16 +class TestUrgencyParent : 1.17 + public PTestUrgencyParent 1.18 +{ 1.19 +public: 1.20 + TestUrgencyParent(); 1.21 + virtual ~TestUrgencyParent(); 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 + bool RecvTest1(uint32_t *value); 1.29 + bool RecvTest2(); 1.30 + bool RecvTest3(uint32_t *value); 1.31 + bool RecvTest4_Begin(); 1.32 + bool RecvTest4_NestedSync(); 1.33 + bool RecvFinalTest_Begin(); 1.34 + 1.35 + bool ShouldContinueFromReplyTimeout() MOZ_OVERRIDE 1.36 + { 1.37 + return false; 1.38 + } 1.39 + virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE 1.40 + { 1.41 + if (AbnormalShutdown != why) 1.42 + fail("unexpected destruction!"); 1.43 + passed("ok"); 1.44 + QuitParent(); 1.45 + } 1.46 + 1.47 +private: 1.48 + bool inreply_; 1.49 +}; 1.50 + 1.51 + 1.52 +class TestUrgencyChild : 1.53 + public PTestUrgencyChild 1.54 +{ 1.55 +public: 1.56 + TestUrgencyChild(); 1.57 + virtual ~TestUrgencyChild(); 1.58 + 1.59 + bool RecvStart(); 1.60 + bool AnswerReply1(uint32_t *reply); 1.61 + bool AnswerReply2(uint32_t *reply); 1.62 + bool AnswerTest4_Reenter(); 1.63 + bool AnswerFinalTest_Hang(); 1.64 + 1.65 + virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE 1.66 + { 1.67 + if (AbnormalShutdown != why) 1.68 + fail("unexpected destruction!"); 1.69 + QuitChild(); 1.70 + } 1.71 + 1.72 +private: 1.73 + uint32_t test_; 1.74 +}; 1.75 + 1.76 + 1.77 +} // namespace _ipdltest 1.78 +} // namespace mozilla 1.79 + 1.80 + 1.81 +#endif // ifndef mozilla__ipdltest_TestUrgency_h