ipc/ipdl/test/cxx/TestManyChildAllocs.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/ipc/ipdl/test/cxx/TestManyChildAllocs.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,93 @@
     1.4 +#ifndef mozilla__ipdltest_TestManyChildAllocs_h
     1.5 +#define mozilla__ipdltest_TestManyChildAllocs_h 1
     1.6 +
     1.7 +#include "mozilla/_ipdltest/IPDLUnitTests.h"
     1.8 +
     1.9 +#include "mozilla/_ipdltest/PTestManyChildAllocsParent.h"
    1.10 +#include "mozilla/_ipdltest/PTestManyChildAllocsChild.h"
    1.11 +
    1.12 +#include "mozilla/_ipdltest/PTestManyChildAllocsSubParent.h"
    1.13 +#include "mozilla/_ipdltest/PTestManyChildAllocsSubChild.h"
    1.14 +
    1.15 +namespace mozilla {
    1.16 +namespace _ipdltest {
    1.17 +
    1.18 +// top-level protocol
    1.19 +
    1.20 +class TestManyChildAllocsParent :
    1.21 +    public PTestManyChildAllocsParent
    1.22 +{
    1.23 +public:
    1.24 +    TestManyChildAllocsParent();
    1.25 +    virtual ~TestManyChildAllocsParent();
    1.26 +
    1.27 +    static bool RunTestInProcesses() { return true; }
    1.28 +    static bool RunTestInThreads() { return true; }
    1.29 +
    1.30 +    void Main();
    1.31 +
    1.32 +protected:
    1.33 +    virtual bool RecvDone() MOZ_OVERRIDE;
    1.34 +    virtual bool DeallocPTestManyChildAllocsSubParent(PTestManyChildAllocsSubParent* __a) MOZ_OVERRIDE;
    1.35 +    virtual PTestManyChildAllocsSubParent* AllocPTestManyChildAllocsSubParent() MOZ_OVERRIDE;
    1.36 +
    1.37 +    virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    1.38 +    {
    1.39 +        if (NormalShutdown != why)
    1.40 +            fail("unexpected destruction!");
    1.41 +        passed("ok");
    1.42 +        QuitParent();
    1.43 +    }
    1.44 +};
    1.45 +
    1.46 +
    1.47 +class TestManyChildAllocsChild :
    1.48 +    public PTestManyChildAllocsChild
    1.49 +{
    1.50 +public:
    1.51 +    TestManyChildAllocsChild();
    1.52 +    virtual ~TestManyChildAllocsChild();
    1.53 +
    1.54 +protected:
    1.55 +    virtual bool RecvGo() MOZ_OVERRIDE;
    1.56 +    virtual bool DeallocPTestManyChildAllocsSubChild(PTestManyChildAllocsSubChild* __a) MOZ_OVERRIDE;
    1.57 +    virtual PTestManyChildAllocsSubChild* AllocPTestManyChildAllocsSubChild() MOZ_OVERRIDE;
    1.58 +
    1.59 +    virtual void ActorDestroy(ActorDestroyReason why) MOZ_OVERRIDE
    1.60 +    {
    1.61 +        if (NormalShutdown != why)
    1.62 +            fail("unexpected destruction!");
    1.63 +        QuitChild();
    1.64 +    }
    1.65 +};
    1.66 +
    1.67 +
    1.68 +// do-nothing sub-protocol actors
    1.69 +
    1.70 +class TestManyChildAllocsSubParent :
    1.71 +    public PTestManyChildAllocsSubParent
    1.72 +{
    1.73 +public:
    1.74 +    TestManyChildAllocsSubParent() { }
    1.75 +    virtual ~TestManyChildAllocsSubParent() { }
    1.76 +
    1.77 +protected:
    1.78 +    virtual bool RecvHello() MOZ_OVERRIDE { return true; }
    1.79 +};
    1.80 +
    1.81 +
    1.82 +class TestManyChildAllocsSubChild :
    1.83 +    public PTestManyChildAllocsSubChild
    1.84 +{
    1.85 +public:
    1.86 +    TestManyChildAllocsSubChild() { }
    1.87 +    virtual ~TestManyChildAllocsSubChild() { }
    1.88 +};
    1.89 +
    1.90 +
    1.91 +
    1.92 +} // namepsace _ipdltest
    1.93 +} // namespace mozilla
    1.94 +
    1.95 +
    1.96 +#endif // ifndef mozilla__ipdltest_TestManyChildAllocs_h

mercurial