예제 #1
0
bool
TestRPCRacesChild::RecvWakeup()
{
    bool dontcare;
    if (!CallRace(&dontcare))
        fail("can't set up race condition");

    mHasReply = true;
    return true;
}
예제 #2
0
bool
TestRPCRacesParent::AnswerStackFrame()
{
    if (!SendWakeup())
        fail("can't wake up the child");

    if (!CallRace(&mChildHasReply))
        fail("can't set up race condition");
    mHasReply = true;

    if (!mChildHasReply)
        fail("child should have got a reply already");

    return true;
}
예제 #3
0
void
TestRPCRacesParent::OnRaceTime()
{
    if (!CallRace(&mChildHasReply))
        fail("problem calling Race()");

    if (!mChildHasReply)
        fail("child should have got a reply already");

    mHasReply = true;

    MessageLoop::current()->PostTask(
        FROM_HERE,
        NewRunnableMethod(this, &TestRPCRacesParent::Test2));
}
예제 #4
0
//-----------------------------------------------------------------------------
// child
bool
TestRPCRacesChild::RecvStart()
{
    puts("Test 1");

    if (!SendStartRace())
        fail("problem sending StartRace()");

    bool dontcare;
    if (!CallRace(&dontcare))
        fail("problem calling Race()");

    mHasReply = true;
    return true;
}
예제 #5
0
mozilla::ipc::IPCResult
TestRacyUndeferParent::AnswerSpam()
{
    static bool spammed = false;
    static bool raced = false;
    if (!spammed) {
        spammed = true;

        if (!SendAwakenSpam())
            fail("sending AwakenSpam");
    }
    else if (!raced) {
        raced = true;

        if (!SendAwakenRaceWinTwice())
            fail("sending WinRaceTwice");

        if (!CallRace())
            fail("calling Race1");
    }
    return IPC_OK();
}