ipc/ipdl/test/cxx/TestSyncHang.h

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

mercurial