зеркало из https://github.com/mozilla/gecko-dev.git
Test for followup to bug 539856.
This commit is contained in:
Родитель
f97af69a21
Коммит
f13dc9d7ae
|
@ -3,7 +3,7 @@ include protocol "PTestShutdownSub.ipdl";
|
|||
namespace mozilla {
|
||||
namespace _ipdltest {
|
||||
|
||||
sync protocol PTestShutdown {
|
||||
rpc protocol PTestShutdown {
|
||||
manages PTestShutdownSub;
|
||||
|
||||
child:
|
||||
|
|
|
@ -4,16 +4,25 @@ include protocol "PTestShutdownSubsub.ipdl";
|
|||
namespace mozilla {
|
||||
namespace _ipdltest {
|
||||
|
||||
sync protocol PTestShutdownSub {
|
||||
rpc protocol PTestShutdownSub {
|
||||
manager PTestShutdown;
|
||||
manages PTestShutdownSubsub;
|
||||
|
||||
both:
|
||||
rpc StackFrame();
|
||||
|
||||
parent:
|
||||
PTestShutdownSubsub(bool expectParentDeleted);
|
||||
sync __delete__();
|
||||
|
||||
state CREATING:
|
||||
recv PTestShutdownSubsub goto CREATING;
|
||||
answer StackFrame goto DUMMYFRAME;
|
||||
|
||||
state DUMMYFRAME:
|
||||
call StackFrame goto DEAD;
|
||||
|
||||
state DEAD:
|
||||
recv __delete__;
|
||||
};
|
||||
|
||||
|
|
|
@ -103,10 +103,10 @@ TestShutdownChild::RecvStart()
|
|||
if (!PTestShutdownSubsubChild::Send__delete__(c2s2))
|
||||
fail("problem sending dtor");
|
||||
|
||||
if (!PTestShutdownSubChild::Send__delete__(c1))
|
||||
fail("problem sending dtor");
|
||||
if (!PTestShutdownSubChild::Send__delete__(c2))
|
||||
fail("problem sending dtor");
|
||||
if (!c1->CallStackFrame())
|
||||
fail("problem creating dummy stack frame");
|
||||
if (!c2->CallStackFrame())
|
||||
fail("problem creating dummy stack frame");
|
||||
}
|
||||
|
||||
// test 2: alloc some actors and subactors, delete managers first
|
||||
|
@ -142,10 +142,10 @@ TestShutdownChild::RecvStart()
|
|||
fail("problem sending ctor");
|
||||
|
||||
// delete parents without deleting kids
|
||||
if (!PTestShutdownSubChild::Send__delete__(c1))
|
||||
fail("problem sending dtor");
|
||||
if (!PTestShutdownSubChild::Send__delete__(c2))
|
||||
fail("problem sending dtor");
|
||||
if (!c1->CallStackFrame())
|
||||
fail("problem creating dummy stack frame");
|
||||
if (!c2->CallStackFrame())
|
||||
fail("problem creating dummy stack frame");
|
||||
}
|
||||
|
||||
// test 3: alloc some actors and subactors, then crash
|
||||
|
@ -197,6 +197,17 @@ TestShutdownChild::ActorDestroy(ActorDestroyReason why)
|
|||
fail("hey wait ... we should have crashed!");
|
||||
}
|
||||
|
||||
bool
|
||||
TestShutdownSubChild::AnswerStackFrame()
|
||||
{
|
||||
if (!PTestShutdownSubChild::Send__delete__(this))
|
||||
fail("problem sending dtor");
|
||||
|
||||
// WATCH OUT! |this| has just deleted
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
TestShutdownSubChild::ActorDestroy(ActorDestroyReason why)
|
||||
{
|
||||
|
|
|
@ -58,6 +58,13 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
NS_OVERRIDE
|
||||
virtual bool
|
||||
AnswerStackFrame()
|
||||
{
|
||||
return CallStackFrame();
|
||||
}
|
||||
|
||||
NS_OVERRIDE
|
||||
virtual PTestShutdownSubsubParent*
|
||||
AllocPTestShutdownSubsub(const bool& expectParentDelete)
|
||||
|
@ -159,6 +166,9 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
NS_OVERRIDE
|
||||
virtual bool AnswerStackFrame();
|
||||
|
||||
NS_OVERRIDE
|
||||
virtual PTestShutdownSubsubChild*
|
||||
AllocPTestShutdownSubsub(const bool& expectParentDelete)
|
||||
|
|
Загрузка…
Ссылка в новой задаче