B2G/gecko/toolkit/components/places/tests/favicons/head_favicons.js
/**
 * Checks that the favicon for the given page matches the provided data.
 *
 * @param aPageURI
 *        nsIURI object for the page to check.
 * @param aExpectedMimeType
 *        Expected MIME type of the icon, for example "image/png".
 * @param aExpectedData
 *        Expected icon data, expressed as an array of byte values.
 * @param aCallback
 *        This function is called after the check finished.
 */
Checks that the favicon for the given page matches the provided data.
@param aPageURI
nsIURI object for the page to check.
@param aExpectedMimeType
Expected MIME type of the icon, for example "image/png".
@param aExpectedData
Expected icon data, expressed as an array of byte values.
@param aCallback
This function is called after the check finished.
Checks that the favicon for the given page matches the provided data . @param aPageURI nsIURI object for the page to check . @param aExpectedMimeType Expected MIME type of the icon for example " image / png " . @param aExpectedData Expected icon data expressed as an array of byte values . @param aCallback This function is called after the check finished .
function checkFaviconDataForPage(aPageURI, aExpectedMimeType, aExpectedData,
                                 aCallback) {
  PlacesUtils.favicons.getFaviconDataForPage(aPageURI,
    function (aURI, aDataLen, aData, aMimeType) {
      do_check_eq(aExpectedMimeType, aMimeType);
      do_check_true(compareArrays(aExpectedData, aData));
      do_check_guid_for_uri(aPageURI);
      aCallback();
    });
}
function checkFaviconDataForPage ( aPageURI , aExpectedMimeType , aExpectedData , aCallback ) { PlacesUtils . favicons . getFaviconDataForPage ( aPageURI , function ( aURI , aDataLen , aData , aMimeType ) { do_check_eq ( aExpectedMimeType , aMimeType ) ; do_check_true ( compareArrays ( aExpectedData , aData ) ) ; do_check_guid_for_uri ( aPageURI ) ; aCallback ( ) ; } ) ; }
Checks that the favicon for the given page matches the provided data.
Checks that the favicon for the given page matches the provided data .