ipc/ipdl/test/cxx/TestSyncError.h

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:8d4347a13ade
1 #ifndef mozilla__ipdltest_TestSyncError_h
2 #define mozilla__ipdltest_TestSyncError_h 1
3
4 #include "mozilla/_ipdltest/IPDLUnitTests.h"
5
6 #include "mozilla/_ipdltest/PTestSyncErrorParent.h"
7 #include "mozilla/_ipdltest/PTestSyncErrorChild.h"
8
9 namespace mozilla {
10 namespace _ipdltest {
11
12
13 class TestSyncErrorParent :
14 public PTestSyncErrorParent
15 {
16 public:
17 TestSyncErrorParent();
18 virtual ~TestSyncErrorParent();
19
20 static bool RunTestInProcesses() { return true; }
21 static bool RunTestInThreads() { return true; }
22
23 void Main();
24
25 protected:
26 virtual bool RecvError() MOZ_OVERRIDE;
27
28 virtual void ProcessingError(Result what) MOZ_OVERRIDE
29 {
30 // Ignore errors
31 }
32
33 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
34 {
35 if (NormalShutdown != why)
36 fail("unexpected destruction!");
37 passed("ok");
38 QuitParent();
39 }
40 };
41
42
43 class TestSyncErrorChild :
44 public PTestSyncErrorChild
45 {
46 public:
47 TestSyncErrorChild();
48 virtual ~TestSyncErrorChild();
49
50 protected:
51 virtual bool RecvStart() MOZ_OVERRIDE;
52
53 virtual void ProcessingError(Result what) MOZ_OVERRIDE
54 {
55 // Ignore errors
56 }
57
58 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
59 {
60 if (NormalShutdown != why)
61 fail("unexpected destruction!");
62 QuitChild();
63 }
64 };
65
66
67 } // namespace _ipdltest
68 } // namespace mozilla
69
70
71 #endif // ifndef mozilla__ipdltest_TestSyncError_h

mercurial