B2G/gecko/browser/components/thumbnails/test/head.js
/**
 * Continues the current test execution when a load event for the given element
 * has been received.
 * @param aElement The DOM element to listen on.
 * @param aCallback The function to call when the load event was dispatched.
 */
Continues the current test execution when a load event for the given element
has been received.
@param aElement The DOM element to listen on.
@param aCallback The function to call when the load event was dispatched.
Continues the current test execution when a load event for the given element has been received . @param aElement The DOM element to listen on . @param aCallback The function to call when the load event was dispatched .
function whenLoaded(aElement, aCallback) {
  aElement.addEventListener("load", function onLoad() {
    aElement.removeEventListener("load", onLoad, true);
    executeSoon(aCallback || next);
  }, true);
}
function whenLoaded ( aElement , aCallback ) { aElement . addEventListener ( "load" , function onLoad ( ) { aElement . removeEventListener ( "load" , onLoad , true ) ; executeSoon ( aCallback || next ) ; } , true ) ; }
Continues the current test execution when a load event for the given element
 has been received.
Continues the current test execution when a load event for the given element has been received .