bool TestRPCRacesChild::RecvWakeup() { bool dontcare; if (!CallRace(&dontcare)) fail("can't set up race condition"); mHasReply = true; return true; }
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; }
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)); }
//----------------------------------------------------------------------------- // 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; }
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(); }