B2G/gecko/toolkit/mozapps/update/test/chrome/utils.js
/**
 * Waits until a remotecontent element to finish loading which is determined
 * by the current test's expectedRemoteContentState property and then removes
 * the event listener.
 *
 * Note: tests that use this function should not test the state of the
 *      remotecontent since this will check the expected state.
 *
 * @return false if the remotecontent has loaded and its state is the state
 *         specified in the current test's expectedRemoteContentState
 *         property... otherwise true.
 */
Waits until a remotecontent element to finish loading which is determined
by the current test's expectedRemoteContentState property and then removes
the event listener.

tests that use this function should not test the state of the
remotecontent since this will check the expected state.

@return false if the remotecontent has loaded and its state is the state
specified in the current test's expectedRemoteContentState
property... otherwise true.
Waits until a remotecontent element to finish loading which is determined by the current test ' s expectedRemoteContentState property and then removes the event listener . tests that use this function should not test the state of the remotecontent since this will check the expected state . @return false if the remotecontent has loaded and its state is the state specified in the current test ' s expectedRemoteContentState property ... otherwise true .
function waitForRemoteContentLoaded(aEvent) {
  if (gRemoteContentState != gTest.expectedRemoteContentState ||
      aEvent.originalTarget != gRemoteContent) {
    debugDump("returning early\n" +
              "gRemoteContentState: " + gRemoteContentState + "\n" +
              "expectedRemoteContentState: " +
              gTest.expectedRemoteContentState + "\n" +
              "aEvent.originalTarget.nodeName: " +
              aEvent.originalTarget.nodeName);
    return true;
  }
  gRemoteContent.removeEventListener("load", remoteContentLoadListener, false);
  return false;
}
function waitForRemoteContentLoaded ( aEvent ) { if ( gRemoteContentState != gTest . expectedRemoteContentState || aEvent . originalTarget != gRemoteContent ) { debugDump ( "returning early\n" + "gRemoteContentState: " + gRemoteContentState + "\n" + "expectedRemoteContentState: " + gTest . expectedRemoteContentState + "\n" + "aEvent.originalTarget.nodeName: " + aEvent . originalTarget . nodeName ) ; return true ; } gRemoteContent . removeEventListener ( "load" , remoteContentLoadListener , false ) ; return false ; }
Waits until a remotecontent element to finish loading which is determined
 by the current test's expectedRemoteContentState property and then removes
 the event listener.
Waits until a remotecontent element to finish loading which is determined by the current test ' s expectedRemoteContentState property and then removes the event listener .
// Return early until the remotecontent has loaded with the state that is // expected or isn't the event's originalTarget.