ipc/ipdl/test/cxx/TestSyncWakeup.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ipc/ipdl/test/cxx/TestSyncWakeup.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,74 @@
     1.4 +#ifndef mozilla__ipdltest_TestSyncWakeup_h
     1.5 +#define mozilla__ipdltest_TestSyncWakeup_h 1
     1.6 +
     1.7 +#include "mozilla/_ipdltest/IPDLUnitTests.h"
     1.8 +
     1.9 +#include "mozilla/_ipdltest/PTestSyncWakeupParent.h"
    1.10 +#include "mozilla/_ipdltest/PTestSyncWakeupChild.h"
    1.11 +
    1.12 +namespace mozilla {
    1.13 +namespace _ipdltest {
    1.14 +
    1.15 +
    1.16 +class TestSyncWakeupParent :
    1.17 +    public PTestSyncWakeupParent
    1.18 +{
    1.19 +public:
    1.20 +    TestSyncWakeupParent();
    1.21 +    virtual ~TestSyncWakeupParent();
    1.22 +
    1.23 +    static bool RunTestInProcesses() { return true; }
    1.24 +    static bool RunTestInThreads() { return true; }
    1.25 +
    1.26 +    void Main();
    1.27 +
    1.28 +protected:
    1.29 +    virtual bool AnswerStackFrame() MOZ_OVERRIDE;
    1.30 +
    1.31 +    virtual bool RecvSync1() MOZ_OVERRIDE;
    1.32 +
    1.33 +    virtual bool RecvSync2() MOZ_OVERRIDE;
    1.34 +
    1.35 +    virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    1.36 +    {
    1.37 +        if (NormalShutdown != why)
    1.38 +            fail("unexpected destruction!");  
    1.39 +        passed("ok");
    1.40 +        QuitParent();
    1.41 +    }
    1.42 +};
    1.43 +
    1.44 +
    1.45 +class TestSyncWakeupChild :
    1.46 +    public PTestSyncWakeupChild
    1.47 +{
    1.48 +public:
    1.49 +    TestSyncWakeupChild();
    1.50 +    virtual ~TestSyncWakeupChild();
    1.51 +
    1.52 +protected:
    1.53 +    virtual bool RecvStart() MOZ_OVERRIDE;
    1.54 +
    1.55 +    virtual bool RecvNote1() MOZ_OVERRIDE;
    1.56 +
    1.57 +    virtual bool AnswerStackFrame() MOZ_OVERRIDE;
    1.58 +
    1.59 +    virtual bool RecvNote2() MOZ_OVERRIDE;
    1.60 +
    1.61 +    virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    1.62 +    {
    1.63 +        if (NormalShutdown != why)
    1.64 +            fail("unexpected destruction!");
    1.65 +        QuitChild();
    1.66 +    }
    1.67 +
    1.68 +private:
    1.69 +    bool mDone;
    1.70 +};
    1.71 +
    1.72 +
    1.73 +} // namespace _ipdltest
    1.74 +} // namespace mozilla
    1.75 +
    1.76 +
    1.77 +#endif // ifndef mozilla__ipdltest_TestSyncWakeup_h

mercurial