зеркало из https://github.com/mozilla/gecko-dev.git
Test for followup to bug 539856.
--HG-- extra : transplant_source : f%83f%28%DC%A9%09%ADm%C3Ra%C5%D4%A7%A5%B2%D8%EDb
This commit is contained in:
Родитель
1a09d5ee52
Коммит
f1e8661419
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче