ipc/ipdl/test/cxx/TestSyncError.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ipc/ipdl/test/cxx/TestSyncError.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,71 @@
     1.4 +#ifndef mozilla__ipdltest_TestSyncError_h
     1.5 +#define mozilla__ipdltest_TestSyncError_h 1
     1.6 +
     1.7 +#include "mozilla/_ipdltest/IPDLUnitTests.h"
     1.8 +
     1.9 +#include "mozilla/_ipdltest/PTestSyncErrorParent.h"
    1.10 +#include "mozilla/_ipdltest/PTestSyncErrorChild.h"
    1.11 +
    1.12 +namespace mozilla {
    1.13 +namespace _ipdltest {
    1.14 +
    1.15 +
    1.16 +class TestSyncErrorParent :
    1.17 +    public PTestSyncErrorParent
    1.18 +{
    1.19 +public:
    1.20 +    TestSyncErrorParent();
    1.21 +    virtual ~TestSyncErrorParent();
    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 RecvError() MOZ_OVERRIDE;
    1.30 +
    1.31 +    virtual void ProcessingError(Result what) MOZ_OVERRIDE
    1.32 +    {
    1.33 +        // Ignore errors
    1.34 +    }
    1.35 +
    1.36 +    virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    1.37 +    {
    1.38 +        if (NormalShutdown != why)
    1.39 +            fail("unexpected destruction!");  
    1.40 +        passed("ok");
    1.41 +        QuitParent();
    1.42 +    }
    1.43 +};
    1.44 +
    1.45 +
    1.46 +class TestSyncErrorChild :
    1.47 +    public PTestSyncErrorChild
    1.48 +{
    1.49 +public:
    1.50 +    TestSyncErrorChild();
    1.51 +    virtual ~TestSyncErrorChild();
    1.52 +
    1.53 +protected:
    1.54 +    virtual bool RecvStart() MOZ_OVERRIDE;
    1.55 +
    1.56 +    virtual void ProcessingError(Result what) MOZ_OVERRIDE
    1.57 +    {
    1.58 +        // Ignore errors
    1.59 +    }
    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 +
    1.69 +
    1.70 +} // namespace _ipdltest
    1.71 +} // namespace mozilla
    1.72 +
    1.73 +
    1.74 +#endif // ifndef mozilla__ipdltest_TestSyncError_h

mercurial