void () { int doneTestCount = myFinishedTestCount; // update progress if (isUndefined()) { myStatusLine.setFraction(1.0); } else if (myTotalTestCount != 0) { // if total is set myStatusLine.setFraction((double) doneTestCount / myTotalTestCount); } else { // if at least one test was launcher than just set progress in the middle to show user that tests are running myStatusLine.setFraction(doneTestCount > 0 ? 0.5 : 0); } }