|
1 #ifndef mozilla__ipdltest_TestCrashCleanup_h |
|
2 #define mozilla__ipdltest_TestCrashCleanup_h 1 |
|
3 |
|
4 #include "mozilla/_ipdltest/IPDLUnitTests.h" |
|
5 |
|
6 #include "mozilla/_ipdltest/PTestCrashCleanupParent.h" |
|
7 #include "mozilla/_ipdltest/PTestCrashCleanupChild.h" |
|
8 |
|
9 namespace mozilla { |
|
10 namespace _ipdltest { |
|
11 |
|
12 |
|
13 class TestCrashCleanupParent : |
|
14 public PTestCrashCleanupParent |
|
15 { |
|
16 public: |
|
17 TestCrashCleanupParent(); |
|
18 virtual ~TestCrashCleanupParent(); |
|
19 |
|
20 static bool RunTestInProcesses() { return true; } |
|
21 static bool RunTestInThreads() { return false; } |
|
22 |
|
23 void Main(); |
|
24 |
|
25 protected: |
|
26 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
|
27 { |
|
28 if (AbnormalShutdown != why) |
|
29 fail("unexpected destruction!"); |
|
30 mCleanedUp = true; |
|
31 } |
|
32 |
|
33 bool mCleanedUp; |
|
34 }; |
|
35 |
|
36 |
|
37 class TestCrashCleanupChild : |
|
38 public PTestCrashCleanupChild |
|
39 { |
|
40 public: |
|
41 TestCrashCleanupChild(); |
|
42 virtual ~TestCrashCleanupChild(); |
|
43 |
|
44 protected: |
|
45 virtual bool AnswerDIEDIEDIE() MOZ_OVERRIDE; |
|
46 |
|
47 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
|
48 { |
|
49 fail("should have 'crashed'!"); |
|
50 } |
|
51 }; |
|
52 |
|
53 |
|
54 } // namespace _ipdltest |
|
55 } // namespace mozilla |
|
56 |
|
57 |
|
58 #endif // ifndef mozilla__ipdltest_TestCrashCleanup_h |