gecko/ipc/ipdl/test/cxx/TestSyncWakeup.h
Chris Jones 00ee801a2c Test for bug 538239.
--HG--
extra : transplant_source : 8e%9E%87%3F%D1%EE%A7%3A%AB%19%84%AD%C1%DD%13%CE%82%E3w
2010-01-20 21:50:07 -06:00

81 lines
1.4 KiB
C++

#ifndef mozilla__ipdltest_TestSyncWakeup_h
#define mozilla__ipdltest_TestSyncWakeup_h 1
#include "mozilla/_ipdltest/IPDLUnitTests.h"
#include "mozilla/_ipdltest/PTestSyncWakeupParent.h"
#include "mozilla/_ipdltest/PTestSyncWakeupChild.h"
namespace mozilla {
namespace _ipdltest {
class TestSyncWakeupParent :
public PTestSyncWakeupParent
{
public:
TestSyncWakeupParent();
virtual ~TestSyncWakeupParent();
void Main();
protected:
NS_OVERRIDE
virtual bool AnswerStackFrame();
NS_OVERRIDE
virtual bool RecvSync1();
NS_OVERRIDE
virtual bool RecvSync2();
NS_OVERRIDE
virtual void ActorDestroy(ActorDestroyReason why)
{
if (NormalShutdown != why)
fail("unexpected destruction!");
passed("ok");
QuitParent();
}
};
class TestSyncWakeupChild :
public PTestSyncWakeupChild
{
public:
TestSyncWakeupChild();
virtual ~TestSyncWakeupChild();
protected:
NS_OVERRIDE
virtual bool RecvStart();
NS_OVERRIDE
virtual bool RecvNote1();
NS_OVERRIDE
virtual bool AnswerStackFrame();
NS_OVERRIDE
virtual bool RecvNote2();
NS_OVERRIDE
virtual void ActorDestroy(ActorDestroyReason why)
{
if (NormalShutdown != why)
fail("unexpected destruction!");
QuitChild();
}
private:
bool mDone;
};
} // namespace _ipdltest
} // namespace mozilla
#endif // ifndef mozilla__ipdltest_TestSyncWakeup_h