ipc/ipdl/test/cxx/TestRacyUndefer.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_TestRacyUndefer_h
     2 #define mozilla__ipdltest_TestRacyUndefer_h 1
     4 #include "mozilla/_ipdltest/IPDLUnitTests.h"
     6 #include "mozilla/_ipdltest/PTestRacyUndeferParent.h"
     7 #include "mozilla/_ipdltest/PTestRacyUndeferChild.h"
     9 namespace mozilla {
    10 namespace _ipdltest {
    13 class TestRacyUndeferParent :
    14     public PTestRacyUndeferParent
    15 {
    16 public:
    17     TestRacyUndeferParent();
    18     virtual ~TestRacyUndeferParent();
    20     static bool RunTestInProcesses() { return true; }
    21     static bool RunTestInThreads() { return true; }
    23     void Main();
    25 protected:    
    26     virtual bool AnswerSpam() MOZ_OVERRIDE;
    28     virtual bool AnswerRaceWinTwice() MOZ_OVERRIDE;
    30     virtual bool RecvDone() MOZ_OVERRIDE;
    32     virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    33     {
    34         if (NormalShutdown != why)
    35             fail("unexpected destruction!");  
    36         passed("ok");
    37         QuitParent();
    38     }
    39 };
    42 class TestRacyUndeferChild :
    43     public PTestRacyUndeferChild
    44 {
    45 public:
    46     TestRacyUndeferChild();
    47     virtual ~TestRacyUndeferChild();
    49 protected:
    50     virtual bool RecvStart() MOZ_OVERRIDE;
    52     virtual bool RecvAwakenSpam() MOZ_OVERRIDE;
    53     virtual bool RecvAwakenRaceWinTwice() MOZ_OVERRIDE;
    55     virtual bool AnswerRace() MOZ_OVERRIDE;
    57     virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    58     {
    59         if (NormalShutdown != why)
    60             fail("unexpected destruction!");
    61         QuitChild();
    62     }
    63 };
    66 } // namespace _ipdltest
    67 } // namespace mozilla
    70 #endif // ifndef mozilla__ipdltest_TestRacyUndefer_h

mercurial