ipc/ipdl/test/cxx/TestRacyReentry.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_TestRacyReentry_h
     2 #define mozilla__ipdltest_TestRacyReentry_h 1
     4 #include "mozilla/_ipdltest/IPDLUnitTests.h"
     6 #include "mozilla/_ipdltest/PTestRacyReentryParent.h"
     7 #include "mozilla/_ipdltest/PTestRacyReentryChild.h"
     9 namespace mozilla {
    10 namespace _ipdltest {
    13 class TestRacyReentryParent :
    14     public PTestRacyReentryParent
    15 {
    16 public:
    17     TestRacyReentryParent();
    18     virtual ~TestRacyReentryParent();
    20     static bool RunTestInProcesses() { return true; }
    21     static bool RunTestInThreads() { return true; }
    23     void Main();
    25 protected:
    26     virtual bool AnswerE() MOZ_OVERRIDE;
    28     virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    29     {
    30         if (NormalShutdown != why)
    31             fail("unexpected destruction!");  
    32         passed("ok");
    33         QuitParent();
    34     }
    36     bool mRecvdE;
    37 };
    40 class TestRacyReentryChild :
    41     public PTestRacyReentryChild
    42 {
    43 public:
    44     TestRacyReentryChild();
    45     virtual ~TestRacyReentryChild();
    47 protected:
    48     virtual bool RecvStart() MOZ_OVERRIDE;
    50     virtual bool RecvN() MOZ_OVERRIDE;
    52     virtual bool AnswerH() 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
    67 #endif // ifndef mozilla__ipdltest_TestRacyReentry_h

mercurial