| |
1 #ifndef mozilla__ipdltest_TestInterruptShutdownRace_h |
| |
2 #define mozilla__ipdltest_TestInterruptShutdownRace_h 1 |
| |
3 |
| |
4 #include "mozilla/_ipdltest/IPDLUnitTests.h" |
| |
5 |
| |
6 #include "mozilla/_ipdltest/PTestInterruptShutdownRaceParent.h" |
| |
7 #include "mozilla/_ipdltest/PTestInterruptShutdownRaceChild.h" |
| |
8 |
| |
9 namespace mozilla { |
| |
10 namespace _ipdltest { |
| |
11 |
| |
12 |
| |
13 class TestInterruptShutdownRaceParent : |
| |
14 public PTestInterruptShutdownRaceParent |
| |
15 { |
| |
16 public: |
| |
17 TestInterruptShutdownRaceParent(); |
| |
18 virtual ~TestInterruptShutdownRaceParent(); |
| |
19 |
| |
20 static bool RunTestInProcesses() { return true; } |
| |
21 // FIXME/bug 703323 Could work if modified |
| |
22 static bool RunTestInThreads() { return false; } |
| |
23 |
| |
24 void Main(); |
| |
25 |
| |
26 virtual bool RecvStartDeath() MOZ_OVERRIDE; |
| |
27 |
| |
28 virtual bool RecvOrphan() MOZ_OVERRIDE; |
| |
29 |
| |
30 protected: |
| |
31 void StartShuttingDown(); |
| |
32 |
| |
33 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
| |
34 { |
| |
35 if (AbnormalShutdown != why) |
| |
36 fail("unexpected destruction!"); |
| |
37 } |
| |
38 }; |
| |
39 |
| |
40 |
| |
41 class TestInterruptShutdownRaceChild : |
| |
42 public PTestInterruptShutdownRaceChild |
| |
43 { |
| |
44 public: |
| |
45 TestInterruptShutdownRaceChild(); |
| |
46 virtual ~TestInterruptShutdownRaceChild(); |
| |
47 |
| |
48 protected: |
| |
49 virtual bool RecvStart() MOZ_OVERRIDE; |
| |
50 |
| |
51 virtual bool AnswerExit() MOZ_OVERRIDE; |
| |
52 |
| |
53 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
| |
54 { |
| |
55 fail("should have 'crashed'!"); |
| |
56 } |
| |
57 }; |
| |
58 |
| |
59 |
| |
60 } // namespace _ipdltest |
| |
61 } // namespace mozilla |
| |
62 |
| |
63 |
| |
64 #endif // ifndef mozilla__ipdltest_TestInterruptShutdownRace_h |