code: public void waitForOperaIdle(long timeout) {
      if (captureIdleEvents && capturedIdleEvents > 0) {
        logger.finer("Captured " + capturedIdleEvents + " idle event(s)");
        // reset
        captureIdleEvents = false;
        capturedIdleEvents = 0;
        return;
      }
  
      // If we're waiting for an Idle event, then we don't need to capture them anymore.  If we've
      // reached this far then capturedIdleEvents is already 0.
      captureIdleEvents = false;
      waitAndParseResult(timeout, 0 /*0 = no window id!*/, null, ResponseType.OPERA_IDLE);
    }
docs: Waits for an OperaIdle event before continuing. <p/> If captureOperaIdle() has been called
  since the last call of waitForOperaIdle(), and one or more OperaIdle events have occurred then
  this method will return immediately. <p/> After calling this method the capturing of OperaIdle
  events is disabled until the next call of captureOperaIdle()
  
  @param timeout time in milliseconds to wait before aborting