ipc/ipdl/test/cxx/TestSysVShmem.h

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

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

mercurial