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 #include "TestRacyReentry.h"
3 #include "IPDLUnitTests.h" // fail etc.
5 namespace mozilla {
6 namespace _ipdltest {
8 //-----------------------------------------------------------------------------
9 // parent
11 TestRacyReentryParent::TestRacyReentryParent() : mRecvdE(false)
12 {
13 MOZ_COUNT_CTOR(TestRacyReentryParent);
14 }
16 TestRacyReentryParent::~TestRacyReentryParent()
17 {
18 MOZ_COUNT_DTOR(TestRacyReentryParent);
19 }
21 void
22 TestRacyReentryParent::Main()
23 {
24 if (!SendStart())
25 fail("sending Start");
27 if (!SendN())
28 fail("sending N");
29 }
31 bool
32 TestRacyReentryParent::AnswerE()
33 {
34 if (!mRecvdE) {
35 mRecvdE = true;
36 return true;
37 }
39 if (!CallH())
40 fail("calling H");
42 return true;
43 }
45 //-----------------------------------------------------------------------------
46 // child
48 TestRacyReentryChild::TestRacyReentryChild()
49 {
50 MOZ_COUNT_CTOR(TestRacyReentryChild);
51 }
53 TestRacyReentryChild::~TestRacyReentryChild()
54 {
55 MOZ_COUNT_DTOR(TestRacyReentryChild);
56 }
58 bool
59 TestRacyReentryChild::RecvStart()
60 {
61 if (!CallE())
62 fail("calling E");
64 Close();
66 return true;
67 }
69 bool
70 TestRacyReentryChild::RecvN()
71 {
72 if (!CallE())
73 fail("calling E");
74 return true;
75 }
77 bool
78 TestRacyReentryChild::AnswerH()
79 {
80 return true;
81 }
83 } // namespace _ipdltest
84 } // namespace mozilla