Пример #1
0
bool
TestUrgencyParent::RecvFinalTest_Begin()
{
  SetReplyTimeoutMs(2000);
  if (CallFinalTest_Hang())
    fail("should have failed due to timeout");
  if (!GetIPCChannel()->Unsound_IsClosed())
    fail("channel should have closed");

  MessageLoop::current()->PostTask(
      FROM_HERE,
      NewRunnableMethod(this, &TestUrgencyParent::Close));
  return false;
}
Пример #2
0
bool
TestHangsParent::AnswerStackFrame()
{
    if (PTestHangs::HANG != state()) {
        if (CallStackFrame())
            fail("should have timed out!");
    }
    else {
        // minimum possible, 2 ms.  We want to detecting a hang to race
        // with the reply coming in, as reliably as possible
        SetReplyTimeoutMs(2);

        if (CallHang())
            fail("should have timed out!");
    }

    return true;
}
Пример #3
0
mozilla::ipc::IPCResult
TestHangsParent::AnswerStackFrame()
{
    ++mNumAnswerStackFrame;

    // MOZ_ASSERT((PTestHangs::HANG != state()) == (mNumAnswerStackFrame == 1));

    if (mNumAnswerStackFrame == 1) {
        if (CallStackFrame()) {
          fail("should have timed out!");
        }
    } else if (mNumAnswerStackFrame == 2) {
        // minimum possible, 2 ms.  We want to detecting a hang to race
        // with the reply coming in, as reliably as possible
        SetReplyTimeoutMs(2);

        if (CallHang())
            fail("should have timed out!");
    } else {
        fail("unexpected state");
    }

    return IPC_OK();
}