B2G/gecko/testing/mochitest/tests/SimpleTest/TestRunner.js
// function to kick off the test and to check when the test is complete
function to kick off the test and to check when the test is complete
function to kick off the test and to check when the test is complete
function checkComplete() {
    var testWindow = window.open(testPath, 'test window'); 
    if (testWindow.document.readyState == "complete") {
      TestRunner.currentTestURL = testPath;
      TestRunner.updateUI(testWindow.SimpleTest._tests);
      testWindow.close();
      if (TestRunner.repeat == completed  && TestRunner.onComplete) {
        TestRunner.onComplete();
      }
      completed++;
    }
    else {
      setTimeout(checkComplete, 1000);
    }
  }
function checkComplete ( ) { var testWindow = window . open ( testPath , 'test window' ) ; if ( testWindow . document . readyState == "complete" ) { TestRunner . currentTestURL = testPath ; TestRunner . updateUI ( testWindow . SimpleTest . _tests ) ; testWindow . close ( ) ; if ( TestRunner . repeat == completed && TestRunner . onComplete ) { TestRunner . onComplete ( ) ; } completed ++ ; } else { setTimeout ( checkComplete , 1000 ) ; } }
function to kick off the test and to check when the test is complete
function to kick off the test and to check when the test is complete
// kick off the test or find the active window // the test is complete -> mark as complete // wait and check later