Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 #ifndef mozilla__ipdltest_TestCrashCleanup_h
2 #define mozilla__ipdltest_TestCrashCleanup_h 1
4 #include "mozilla/_ipdltest/IPDLUnitTests.h"
6 #include "mozilla/_ipdltest/PTestCrashCleanupParent.h"
7 #include "mozilla/_ipdltest/PTestCrashCleanupChild.h"
9 namespace mozilla {
10 namespace _ipdltest {
13 class TestCrashCleanupParent :
14 public PTestCrashCleanupParent
15 {
16 public:
17 TestCrashCleanupParent();
18 virtual ~TestCrashCleanupParent();
20 static bool RunTestInProcesses() { return true; }
21 static bool RunTestInThreads() { return false; }
23 void Main();
25 protected:
26 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
27 {
28 if (AbnormalShutdown != why)
29 fail("unexpected destruction!");
30 mCleanedUp = true;
31 }
33 bool mCleanedUp;
34 };
37 class TestCrashCleanupChild :
38 public PTestCrashCleanupChild
39 {
40 public:
41 TestCrashCleanupChild();
42 virtual ~TestCrashCleanupChild();
44 protected:
45 virtual bool AnswerDIEDIEDIE() MOZ_OVERRIDE;
47 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
48 {
49 fail("should have 'crashed'!");
50 }
51 };
54 } // namespace _ipdltest
55 } // namespace mozilla
58 #endif // ifndef mozilla__ipdltest_TestCrashCleanup_h