2010-05-22 12:35:37 -07:00
|
|
|
#ifndef mozilla__ipdltest_TestDataStructures_h
|
|
|
|
#define mozilla__ipdltest_TestDataStructures_h 1
|
2009-10-16 16:31:53 -07:00
|
|
|
|
2009-12-03 00:16:28 -08:00
|
|
|
#include "mozilla/_ipdltest/IPDLUnitTests.h"
|
2009-10-16 16:31:53 -07:00
|
|
|
|
2010-05-22 12:35:37 -07:00
|
|
|
#include "mozilla/_ipdltest/PTestDataStructuresParent.h"
|
|
|
|
#include "mozilla/_ipdltest/PTestDataStructuresChild.h"
|
2009-10-16 16:31:53 -07:00
|
|
|
|
2010-05-22 12:35:37 -07:00
|
|
|
#include "mozilla/_ipdltest/PTestDataStructuresSubParent.h"
|
|
|
|
#include "mozilla/_ipdltest/PTestDataStructuresSubChild.h"
|
2009-10-16 16:31:53 -07:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace _ipdltest {
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Subprotocol actors
|
|
|
|
|
2010-05-22 12:35:37 -07:00
|
|
|
class TestDataStructuresSub :
|
|
|
|
public PTestDataStructuresSubParent,
|
|
|
|
public PTestDataStructuresSubChild
|
2009-10-16 16:31:53 -07:00
|
|
|
{
|
|
|
|
public:
|
2010-05-22 12:35:37 -07:00
|
|
|
TestDataStructuresSub(uint32 i) : mI(i)
|
2009-10-16 16:31:53 -07:00
|
|
|
{ }
|
2010-05-22 12:35:37 -07:00
|
|
|
virtual ~TestDataStructuresSub()
|
2009-10-16 16:31:53 -07:00
|
|
|
{ }
|
2009-10-16 17:33:19 -07:00
|
|
|
uint32 mI;
|
2009-10-16 16:31:53 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Main actors
|
|
|
|
|
2010-05-22 12:35:37 -07:00
|
|
|
class TestDataStructuresParent :
|
|
|
|
public PTestDataStructuresParent
|
2009-10-16 16:31:53 -07:00
|
|
|
{
|
|
|
|
public:
|
2010-05-22 12:35:37 -07:00
|
|
|
TestDataStructuresParent();
|
|
|
|
virtual ~TestDataStructuresParent();
|
2009-10-16 16:31:53 -07:00
|
|
|
|
|
|
|
void Main();
|
|
|
|
|
|
|
|
protected:
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2010-05-22 12:35:37 -07:00
|
|
|
virtual PTestDataStructuresSubParent* AllocPTestDataStructuresSub(const int& i)
|
2009-10-16 16:31:53 -07:00
|
|
|
{
|
2010-05-22 12:35:37 -07:00
|
|
|
PTestDataStructuresSubParent* actor = new TestDataStructuresSub(i);
|
2009-10-16 16:31:53 -07:00
|
|
|
mKids.AppendElement(actor);
|
|
|
|
return actor;
|
|
|
|
}
|
|
|
|
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2010-05-22 12:35:37 -07:00
|
|
|
virtual bool DeallocPTestDataStructuresSub(PTestDataStructuresSubParent* actor);
|
2009-10-16 16:31:53 -07:00
|
|
|
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2009-10-16 16:31:53 -07:00
|
|
|
virtual bool RecvTest1(
|
|
|
|
const nsTArray<int>& i1,
|
|
|
|
nsTArray<int>* o1);
|
|
|
|
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2009-10-16 16:31:53 -07:00
|
|
|
virtual bool RecvTest2(
|
2010-05-22 12:35:37 -07:00
|
|
|
const nsTArray<PTestDataStructuresSubParent*>& i1,
|
|
|
|
nsTArray<PTestDataStructuresSubParent*>* o1);
|
2009-10-16 16:31:53 -07:00
|
|
|
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2009-10-16 16:31:53 -07:00
|
|
|
virtual bool RecvTest3(
|
|
|
|
const IntDouble& i1,
|
|
|
|
const IntDouble& i2,
|
|
|
|
IntDouble* o1,
|
|
|
|
IntDouble* o2);
|
|
|
|
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2009-10-16 16:31:53 -07:00
|
|
|
virtual bool RecvTest4(
|
|
|
|
const nsTArray<IntDouble>& i1,
|
|
|
|
nsTArray<IntDouble>* o1);
|
|
|
|
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2009-10-16 16:31:53 -07:00
|
|
|
virtual bool RecvTest5(
|
|
|
|
const IntDoubleArrays& i1,
|
|
|
|
const IntDoubleArrays& i2,
|
|
|
|
const IntDoubleArrays& i3,
|
|
|
|
IntDoubleArrays* o1,
|
|
|
|
IntDoubleArrays* o2,
|
|
|
|
IntDoubleArrays* o3);
|
|
|
|
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2009-10-16 16:31:53 -07:00
|
|
|
virtual bool RecvTest6(
|
|
|
|
const nsTArray<IntDoubleArrays>& i1,
|
|
|
|
nsTArray<IntDoubleArrays>* o1);
|
|
|
|
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2009-10-16 16:31:53 -07:00
|
|
|
virtual bool RecvTest7(
|
|
|
|
const Actors& i1,
|
|
|
|
const Actors& i2,
|
|
|
|
const Actors& i3,
|
|
|
|
Actors* o1,
|
|
|
|
Actors* o2,
|
|
|
|
Actors* o3);
|
|
|
|
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2009-10-16 16:31:53 -07:00
|
|
|
virtual bool RecvTest8(
|
|
|
|
const nsTArray<Actors>& i1,
|
|
|
|
nsTArray<Actors>* o1);
|
2009-12-03 00:16:28 -08:00
|
|
|
|
|
|
|
NS_OVERRIDE
|
2009-10-16 16:31:53 -07:00
|
|
|
virtual bool RecvTest9(
|
|
|
|
const Unions& i1,
|
|
|
|
const Unions& i2,
|
|
|
|
const Unions& i3,
|
|
|
|
const Unions& i4,
|
|
|
|
Unions* o1,
|
|
|
|
Unions* o2,
|
|
|
|
Unions* o3,
|
|
|
|
Unions* o4);
|
2009-12-03 00:16:28 -08:00
|
|
|
|
|
|
|
NS_OVERRIDE
|
2009-10-16 16:31:53 -07:00
|
|
|
virtual bool RecvTest10(
|
|
|
|
const nsTArray<Unions>& i1,
|
|
|
|
nsTArray<Unions>* o1);
|
|
|
|
|
2010-05-22 12:35:37 -07:00
|
|
|
NS_OVERRIDE
|
|
|
|
virtual bool RecvTest11(
|
|
|
|
const SIntDouble& i,
|
|
|
|
SIntDouble* o);
|
|
|
|
|
|
|
|
NS_OVERRIDE
|
|
|
|
virtual bool RecvTest12(
|
|
|
|
const SIntDoubleArrays& i,
|
|
|
|
SIntDoubleArrays* o);
|
|
|
|
|
|
|
|
NS_OVERRIDE
|
|
|
|
virtual bool RecvTest13(
|
|
|
|
const SActors& i,
|
|
|
|
SActors* o);
|
|
|
|
|
|
|
|
NS_OVERRIDE
|
|
|
|
virtual bool RecvTest14(
|
|
|
|
const Structs& i,
|
|
|
|
Structs* o);
|
|
|
|
|
|
|
|
NS_OVERRIDE
|
|
|
|
virtual bool RecvTest15(
|
|
|
|
const WithStructs& i1,
|
|
|
|
const WithStructs& i2,
|
|
|
|
const WithStructs& i3,
|
|
|
|
const WithStructs& i4,
|
|
|
|
const WithStructs& i5,
|
|
|
|
WithStructs* o1,
|
|
|
|
WithStructs* o2,
|
|
|
|
WithStructs* o3,
|
|
|
|
WithStructs* o4,
|
|
|
|
WithStructs* o5);
|
|
|
|
|
|
|
|
NS_OVERRIDE
|
|
|
|
virtual bool RecvTest16(
|
|
|
|
const WithUnions& i,
|
|
|
|
WithUnions* o);
|
|
|
|
|
2010-06-02 10:56:34 -07:00
|
|
|
NS_OVERRIDE
|
|
|
|
virtual bool RecvTest17(const nsTArray<Op>& sa);
|
|
|
|
|
2010-06-21 13:35:48 -07:00
|
|
|
NS_OVERRIDE
|
|
|
|
virtual bool RecvTest18(const nsTArray<nsIntRegion>& ra);
|
|
|
|
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
|
|
|
virtual void ActorDestroy(ActorDestroyReason why)
|
|
|
|
{
|
|
|
|
if (NormalShutdown != why)
|
|
|
|
fail("unexpected destruction!");
|
|
|
|
passed("ok");
|
|
|
|
QuitParent();
|
|
|
|
}
|
|
|
|
|
2009-10-16 16:31:53 -07:00
|
|
|
private:
|
2010-05-22 12:35:37 -07:00
|
|
|
nsTArray<PTestDataStructuresSubParent*> mKids;
|
2009-10-16 16:31:53 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-05-22 12:35:37 -07:00
|
|
|
class TestDataStructuresChild :
|
|
|
|
public PTestDataStructuresChild
|
2009-10-16 16:31:53 -07:00
|
|
|
{
|
|
|
|
public:
|
2010-05-22 12:35:37 -07:00
|
|
|
TestDataStructuresChild();
|
|
|
|
virtual ~TestDataStructuresChild();
|
2009-10-16 16:31:53 -07:00
|
|
|
|
|
|
|
protected:
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2010-05-22 12:35:37 -07:00
|
|
|
virtual PTestDataStructuresSubChild* AllocPTestDataStructuresSub(const int& i)
|
2009-10-16 16:31:53 -07:00
|
|
|
{
|
2010-05-22 12:35:37 -07:00
|
|
|
PTestDataStructuresSubChild* actor = new TestDataStructuresSub(i);
|
2009-10-16 16:31:53 -07:00
|
|
|
mKids.AppendElement(actor);
|
|
|
|
return actor;
|
|
|
|
}
|
2009-12-03 00:16:28 -08:00
|
|
|
|
|
|
|
NS_OVERRIDE
|
2010-05-22 12:35:37 -07:00
|
|
|
virtual bool DeallocPTestDataStructuresSub(PTestDataStructuresSubChild* actor)
|
2009-10-16 16:31:53 -07:00
|
|
|
{
|
|
|
|
delete actor;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
2009-10-16 16:31:53 -07:00
|
|
|
virtual bool RecvStart();
|
|
|
|
|
2009-12-03 00:16:28 -08:00
|
|
|
NS_OVERRIDE
|
|
|
|
virtual void ActorDestroy(ActorDestroyReason why)
|
|
|
|
{
|
|
|
|
if (NormalShutdown != why)
|
|
|
|
fail("unexpected destruction!");
|
|
|
|
QuitChild();
|
|
|
|
}
|
|
|
|
|
2009-10-16 16:31:53 -07:00
|
|
|
private:
|
|
|
|
void Test1();
|
|
|
|
void Test2();
|
|
|
|
void Test3();
|
|
|
|
void Test4();
|
|
|
|
void Test5();
|
|
|
|
void Test6();
|
|
|
|
void Test7();
|
|
|
|
void Test8();
|
|
|
|
void Test9();
|
|
|
|
void Test10();
|
2010-05-22 12:35:37 -07:00
|
|
|
void Test11();
|
|
|
|
void Test12();
|
|
|
|
void Test13();
|
|
|
|
void Test14();
|
|
|
|
void Test15();
|
|
|
|
void Test16();
|
2010-06-02 10:56:34 -07:00
|
|
|
void Test17();
|
2010-06-21 13:35:48 -07:00
|
|
|
void Test18();
|
2010-05-22 12:35:37 -07:00
|
|
|
|
|
|
|
nsTArray<PTestDataStructuresSubChild*> mKids;
|
2009-10-16 16:31:53 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace _ipdltest
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
|
2010-05-22 12:35:37 -07:00
|
|
|
#endif // ifndef mozilla__ipdltest_TestDataStructures_h
|