|
1 #ifndef mozilla__ipdltest_TestSysVShmem_h |
|
2 #define mozilla__ipdltest_TestSysVShmem_h |
|
3 |
|
4 #include "mozilla/_ipdltest/IPDLUnitTests.h" |
|
5 |
|
6 #include "mozilla/_ipdltest/PTestSysVShmemParent.h" |
|
7 #include "mozilla/_ipdltest/PTestSysVShmemChild.h" |
|
8 |
|
9 namespace mozilla { |
|
10 namespace _ipdltest { |
|
11 |
|
12 |
|
13 class TestSysVShmemParent : |
|
14 public PTestSysVShmemParent |
|
15 { |
|
16 public: |
|
17 TestSysVShmemParent() { } |
|
18 virtual ~TestSysVShmemParent() { } |
|
19 |
|
20 static bool RunTestInProcesses() { return true; } |
|
21 static bool RunTestInThreads() { return true; } |
|
22 |
|
23 void Main(); |
|
24 |
|
25 protected: |
|
26 virtual bool RecvTake( |
|
27 Shmem& mem, |
|
28 Shmem& unsafe, |
|
29 const size_t& expectedSize) MOZ_OVERRIDE; |
|
30 |
|
31 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
|
32 { |
|
33 if (NormalShutdown != why) |
|
34 fail("unexpected destruction!"); |
|
35 passed("ok"); |
|
36 QuitParent(); |
|
37 } |
|
38 }; |
|
39 |
|
40 |
|
41 class TestSysVShmemChild : |
|
42 public PTestSysVShmemChild |
|
43 { |
|
44 public: |
|
45 TestSysVShmemChild() { } |
|
46 virtual ~TestSysVShmemChild() { } |
|
47 |
|
48 protected: |
|
49 virtual bool RecvGive( |
|
50 Shmem& mem, |
|
51 Shmem& unsafe, |
|
52 const size_t& expectedSize) MOZ_OVERRIDE; |
|
53 |
|
54 virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE |
|
55 { |
|
56 if (NormalShutdown != why) |
|
57 fail("unexpected destruction!"); |
|
58 QuitChild(); |
|
59 } |
|
60 }; |
|
61 |
|
62 |
|
63 } // namespace _ipdltest |
|
64 } // namespace mozilla |
|
65 |
|
66 #endif // ifndef mozilla__ipdltest_TestSysVShmem_h |