1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/ipc/ipdl/test/cxx/TestInterruptErrorCleanup.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,60 @@ 1.4 +#ifndef mozilla__ipdltest_TestInterruptErrorCleanup_h 1.5 +#define mozilla__ipdltest_TestInterruptErrorCleanup_h 1 1.6 + 1.7 +#include "mozilla/_ipdltest/IPDLUnitTests.h" 1.8 + 1.9 +#include "mozilla/_ipdltest/PTestInterruptErrorCleanupParent.h" 1.10 +#include "mozilla/_ipdltest/PTestInterruptErrorCleanupChild.h" 1.11 + 1.12 +namespace mozilla { 1.13 +namespace _ipdltest { 1.14 + 1.15 + 1.16 +class TestInterruptErrorCleanupParent : 1.17 + public PTestInterruptErrorCleanupParent 1.18 +{ 1.19 +public: 1.20 + TestInterruptErrorCleanupParent(); 1.21 + virtual ~TestInterruptErrorCleanupParent(); 1.22 + 1.23 + static bool RunTestInProcesses() { return true; } 1.24 + // FIXME/bug 703323 Could work if modified 1.25 + static bool RunTestInThreads() { return false; } 1.26 + 1.27 + void Main(); 1.28 + 1.29 +protected: 1.30 + virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE 1.31 + { 1.32 + if (AbnormalShutdown != why) 1.33 + fail("unexpected destruction!"); 1.34 + } 1.35 + 1.36 + virtual void ProcessingError(Result what) MOZ_OVERRIDE; 1.37 + 1.38 + bool mGotProcessingError; 1.39 +}; 1.40 + 1.41 + 1.42 +class TestInterruptErrorCleanupChild : 1.43 + public PTestInterruptErrorCleanupChild 1.44 +{ 1.45 +public: 1.46 + TestInterruptErrorCleanupChild(); 1.47 + virtual ~TestInterruptErrorCleanupChild(); 1.48 + 1.49 +protected: 1.50 + virtual bool AnswerError() MOZ_OVERRIDE; 1.51 + 1.52 + virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE 1.53 + { 1.54 + fail("should have 'crashed'!"); 1.55 + } 1.56 +}; 1.57 + 1.58 + 1.59 +} // namespace _ipdltest 1.60 +} // namespace mozilla 1.61 + 1.62 + 1.63 +#endif // ifndef mozilla__ipdltest_TestInterruptErrorCleanup_h