mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Convert some of the IPDL C++ test files to use Unix line endings (no bug)
This commit is contained in:
parent
e3812f3bb9
commit
117b7fa829
@ -1,18 +1,18 @@
|
||||
include protocol PTestBadActorSub;
|
||||
|
||||
namespace mozilla {
|
||||
namespace _ipdltest {
|
||||
|
||||
// Test that a parent sending a reentrant __delete__ message
|
||||
// is not killed if a child's message races with the reply.
|
||||
|
||||
rpc protocol PTestBadActor {
|
||||
manages PTestBadActorSub;
|
||||
|
||||
child:
|
||||
PTestBadActorSub();
|
||||
__delete__();
|
||||
};
|
||||
|
||||
} // namespace _ipdltest
|
||||
} // namespace mozilla
|
||||
include protocol PTestBadActorSub;
|
||||
|
||||
namespace mozilla {
|
||||
namespace _ipdltest {
|
||||
|
||||
// Test that a parent sending a reentrant __delete__ message
|
||||
// is not killed if a child's message races with the reply.
|
||||
|
||||
rpc protocol PTestBadActor {
|
||||
manages PTestBadActorSub;
|
||||
|
||||
child:
|
||||
PTestBadActorSub();
|
||||
__delete__();
|
||||
};
|
||||
|
||||
} // namespace _ipdltest
|
||||
} // namespace mozilla
|
||||
|
@ -1,17 +1,17 @@
|
||||
include protocol PTestBadActor;
|
||||
|
||||
namespace mozilla {
|
||||
namespace _ipdltest {
|
||||
|
||||
rpc protocol PTestBadActorSub {
|
||||
manager PTestBadActor;
|
||||
|
||||
child:
|
||||
rpc __delete__();
|
||||
|
||||
parent:
|
||||
Ping();
|
||||
};
|
||||
|
||||
} // namespace _ipdltest
|
||||
} // namespace mozilla
|
||||
include protocol PTestBadActor;
|
||||
|
||||
namespace mozilla {
|
||||
namespace _ipdltest {
|
||||
|
||||
rpc protocol PTestBadActorSub {
|
||||
manager PTestBadActor;
|
||||
|
||||
child:
|
||||
rpc __delete__();
|
||||
|
||||
parent:
|
||||
Ping();
|
||||
};
|
||||
|
||||
} // namespace _ipdltest
|
||||
} // namespace mozilla
|
||||
|
@ -1,51 +1,51 @@
|
||||
#include "TestBadActor.h"
|
||||
#include "IPDLUnitTests.h"
|
||||
#include "mozilla/unused.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace _ipdltest {
|
||||
|
||||
void
|
||||
TestBadActorParent::Main()
|
||||
{
|
||||
// This test is designed to test a race condition where the child sends us
|
||||
// a message on an actor that we've already destroyed. The child process
|
||||
// should die, and the parent process should not abort.
|
||||
|
||||
PTestBadActorSubParent* child = SendPTestBadActorSubConstructor();
|
||||
if (!child)
|
||||
fail("Sending constructor");
|
||||
|
||||
unused << child->Call__delete__(child);
|
||||
}
|
||||
|
||||
PTestBadActorSubParent*
|
||||
TestBadActorParent::AllocPTestBadActorSub()
|
||||
{
|
||||
return new TestBadActorSubParent();
|
||||
}
|
||||
|
||||
bool
|
||||
TestBadActorSubParent::RecvPing()
|
||||
{
|
||||
fail("Shouldn't have received ping.");
|
||||
return false;
|
||||
}
|
||||
|
||||
PTestBadActorSubChild*
|
||||
TestBadActorChild::AllocPTestBadActorSub()
|
||||
{
|
||||
return new TestBadActorSubChild();
|
||||
}
|
||||
|
||||
bool
|
||||
TestBadActorChild::RecvPTestBadActorSubConstructor(PTestBadActorSubChild* actor)
|
||||
{
|
||||
if (!actor->SendPing()) {
|
||||
fail("Couldn't send ping to an actor which supposedly isn't dead yet.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace _ipdltest
|
||||
} // namespace mozilla
|
||||
#include "TestBadActor.h"
|
||||
#include "IPDLUnitTests.h"
|
||||
#include "mozilla/unused.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace _ipdltest {
|
||||
|
||||
void
|
||||
TestBadActorParent::Main()
|
||||
{
|
||||
// This test is designed to test a race condition where the child sends us
|
||||
// a message on an actor that we've already destroyed. The child process
|
||||
// should die, and the parent process should not abort.
|
||||
|
||||
PTestBadActorSubParent* child = SendPTestBadActorSubConstructor();
|
||||
if (!child)
|
||||
fail("Sending constructor");
|
||||
|
||||
unused << child->Call__delete__(child);
|
||||
}
|
||||
|
||||
PTestBadActorSubParent*
|
||||
TestBadActorParent::AllocPTestBadActorSub()
|
||||
{
|
||||
return new TestBadActorSubParent();
|
||||
}
|
||||
|
||||
bool
|
||||
TestBadActorSubParent::RecvPing()
|
||||
{
|
||||
fail("Shouldn't have received ping.");
|
||||
return false;
|
||||
}
|
||||
|
||||
PTestBadActorSubChild*
|
||||
TestBadActorChild::AllocPTestBadActorSub()
|
||||
{
|
||||
return new TestBadActorSubChild();
|
||||
}
|
||||
|
||||
bool
|
||||
TestBadActorChild::RecvPTestBadActorSubConstructor(PTestBadActorSubChild* actor)
|
||||
{
|
||||
if (!actor->SendPing()) {
|
||||
fail("Couldn't send ping to an actor which supposedly isn't dead yet.");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace _ipdltest
|
||||
} // namespace mozilla
|
||||
|
@ -1,91 +1,91 @@
|
||||
#ifndef mozilla__ipdltest_TestBadActor_h
|
||||
#define mozilla__ipdltest_TestBadActor_h
|
||||
|
||||
#include "mozilla/_ipdltest/IPDLUnitTests.h"
|
||||
|
||||
#include "mozilla/_ipdltest/PTestBadActorParent.h"
|
||||
#include "mozilla/_ipdltest/PTestBadActorChild.h"
|
||||
|
||||
#include "mozilla/_ipdltest/PTestBadActorSubParent.h"
|
||||
#include "mozilla/_ipdltest/PTestBadActorSubChild.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace _ipdltest {
|
||||
|
||||
class TestBadActorParent
|
||||
: public PTestBadActorParent
|
||||
{
|
||||
public:
|
||||
TestBadActorParent() { }
|
||||
virtual ~TestBadActorParent() { }
|
||||
|
||||
static bool RunTestInProcesses() { return true; }
|
||||
static bool RunTestInThreads() { return false; }
|
||||
|
||||
void Main();
|
||||
|
||||
protected:
|
||||
NS_OVERRIDE
|
||||
virtual void ActorDestroy(ActorDestroyReason why)
|
||||
{
|
||||
if (AbnormalShutdown != why)
|
||||
fail("unexpected destruction");
|
||||
passed("ok");
|
||||
QuitParent();
|
||||
}
|
||||
|
||||
virtual PTestBadActorSubParent*
|
||||
AllocPTestBadActorSub();
|
||||
|
||||
virtual bool
|
||||
DeallocPTestBadActorSub(PTestBadActorSubParent* actor) {
|
||||
delete actor;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class TestBadActorSubParent
|
||||
: public PTestBadActorSubParent
|
||||
{
|
||||
public:
|
||||
TestBadActorSubParent() { }
|
||||
virtual ~TestBadActorSubParent() { }
|
||||
|
||||
protected:
|
||||
virtual bool RecvPing();
|
||||
};
|
||||
|
||||
class TestBadActorChild
|
||||
: public PTestBadActorChild
|
||||
{
|
||||
public:
|
||||
TestBadActorChild() { }
|
||||
virtual ~TestBadActorChild() { }
|
||||
|
||||
protected:
|
||||
virtual PTestBadActorSubChild*
|
||||
AllocPTestBadActorSub();
|
||||
|
||||
virtual bool
|
||||
DeallocPTestBadActorSub(PTestBadActorSubChild* actor)
|
||||
{
|
||||
delete actor;
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool
|
||||
RecvPTestBadActorSubConstructor(PTestBadActorSubChild* actor);
|
||||
};
|
||||
|
||||
class TestBadActorSubChild
|
||||
: public PTestBadActorSubChild
|
||||
{
|
||||
public:
|
||||
TestBadActorSubChild() { }
|
||||
virtual ~TestBadActorSubChild() { }
|
||||
};
|
||||
|
||||
} // namespace _ipdltest
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla__ipdltest_TestBadActor_h
|
||||
#ifndef mozilla__ipdltest_TestBadActor_h
|
||||
#define mozilla__ipdltest_TestBadActor_h
|
||||
|
||||
#include "mozilla/_ipdltest/IPDLUnitTests.h"
|
||||
|
||||
#include "mozilla/_ipdltest/PTestBadActorParent.h"
|
||||
#include "mozilla/_ipdltest/PTestBadActorChild.h"
|
||||
|
||||
#include "mozilla/_ipdltest/PTestBadActorSubParent.h"
|
||||
#include "mozilla/_ipdltest/PTestBadActorSubChild.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace _ipdltest {
|
||||
|
||||
class TestBadActorParent
|
||||
: public PTestBadActorParent
|
||||
{
|
||||
public:
|
||||
TestBadActorParent() { }
|
||||
virtual ~TestBadActorParent() { }
|
||||
|
||||
static bool RunTestInProcesses() { return true; }
|
||||
static bool RunTestInThreads() { return false; }
|
||||
|
||||
void Main();
|
||||
|
||||
protected:
|
||||
NS_OVERRIDE
|
||||
virtual void ActorDestroy(ActorDestroyReason why)
|
||||
{
|
||||
if (AbnormalShutdown != why)
|
||||
fail("unexpected destruction");
|
||||
passed("ok");
|
||||
QuitParent();
|
||||
}
|
||||
|
||||
virtual PTestBadActorSubParent*
|
||||
AllocPTestBadActorSub();
|
||||
|
||||
virtual bool
|
||||
DeallocPTestBadActorSub(PTestBadActorSubParent* actor) {
|
||||
delete actor;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class TestBadActorSubParent
|
||||
: public PTestBadActorSubParent
|
||||
{
|
||||
public:
|
||||
TestBadActorSubParent() { }
|
||||
virtual ~TestBadActorSubParent() { }
|
||||
|
||||
protected:
|
||||
virtual bool RecvPing();
|
||||
};
|
||||
|
||||
class TestBadActorChild
|
||||
: public PTestBadActorChild
|
||||
{
|
||||
public:
|
||||
TestBadActorChild() { }
|
||||
virtual ~TestBadActorChild() { }
|
||||
|
||||
protected:
|
||||
virtual PTestBadActorSubChild*
|
||||
AllocPTestBadActorSub();
|
||||
|
||||
virtual bool
|
||||
DeallocPTestBadActorSub(PTestBadActorSubChild* actor)
|
||||
{
|
||||
delete actor;
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool
|
||||
RecvPTestBadActorSubConstructor(PTestBadActorSubChild* actor);
|
||||
};
|
||||
|
||||
class TestBadActorSubChild
|
||||
: public PTestBadActorSubChild
|
||||
{
|
||||
public:
|
||||
TestBadActorSubChild() { }
|
||||
virtual ~TestBadActorSubChild() { }
|
||||
};
|
||||
|
||||
} // namespace _ipdltest
|
||||
} // namespace mozilla
|
||||
|
||||
#endif // mozilla__ipdltest_TestBadActor_h
|
||||
|
Loading…
Reference in New Issue
Block a user