ipc/ipdl/test/cxx/TestInterruptShutdownRace.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ipc/ipdl/test/cxx/TestInterruptShutdownRace.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,64 @@
     1.4 +#ifndef mozilla__ipdltest_TestInterruptShutdownRace_h
     1.5 +#define mozilla__ipdltest_TestInterruptShutdownRace_h 1
     1.6 +
     1.7 +#include "mozilla/_ipdltest/IPDLUnitTests.h"
     1.8 +
     1.9 +#include "mozilla/_ipdltest/PTestInterruptShutdownRaceParent.h"
    1.10 +#include "mozilla/_ipdltest/PTestInterruptShutdownRaceChild.h"
    1.11 +
    1.12 +namespace mozilla {
    1.13 +namespace _ipdltest {
    1.14 +
    1.15 +
    1.16 +class TestInterruptShutdownRaceParent :
    1.17 +    public PTestInterruptShutdownRaceParent
    1.18 +{
    1.19 +public:
    1.20 +    TestInterruptShutdownRaceParent();
    1.21 +    virtual ~TestInterruptShutdownRaceParent();
    1.22 +
    1.23 +    static bool RunTestInProcesses() { return true; }
    1.24 +    // FIXME/bug 703323 Could work if modified
    1.25 +    static bool RunTestInThreads() { return false; }
    1.26 +
    1.27 +    void Main();
    1.28 +
    1.29 +    virtual bool RecvStartDeath() MOZ_OVERRIDE;
    1.30 +
    1.31 +    virtual bool RecvOrphan() MOZ_OVERRIDE;
    1.32 +
    1.33 +protected:
    1.34 +    void StartShuttingDown();
    1.35 +
    1.36 +    virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    1.37 +    {
    1.38 +        if (AbnormalShutdown != why)
    1.39 +            fail("unexpected destruction!");  
    1.40 +    }
    1.41 +};
    1.42 +
    1.43 +
    1.44 +class TestInterruptShutdownRaceChild :
    1.45 +    public PTestInterruptShutdownRaceChild
    1.46 +{
    1.47 +public:
    1.48 +    TestInterruptShutdownRaceChild();
    1.49 +    virtual ~TestInterruptShutdownRaceChild();
    1.50 +
    1.51 +protected:
    1.52 +    virtual bool RecvStart() MOZ_OVERRIDE;
    1.53 +
    1.54 +    virtual bool AnswerExit() MOZ_OVERRIDE;
    1.55 +
    1.56 +    virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    1.57 +    {
    1.58 +        fail("should have 'crashed'!");
    1.59 +    }
    1.60 +};
    1.61 +
    1.62 +
    1.63 +} // namespace _ipdltest
    1.64 +} // namespace mozilla
    1.65 +
    1.66 +
    1.67 +#endif // ifndef mozilla__ipdltest_TestInterruptShutdownRace_h

mercurial