build-system/tasks/make-golden.js
/**
 * Create an html report record for an image diff and add it to the report file
 * @param {string} reportFile report file path
 * @param {string} file screenshot file path
 * @param {string} dir screenshot directory path
 * @param {!Object} record screenshot diff results record
 */
Create an html report record for an image diff and add it to the report file
@param {string} reportFile report file path
@param {string} file screenshot file path
@param {string} dir screenshot directory path
@param {!Object} record screenshot diff results record
Create an html report record for an image diff and add it to the report file @param { string } reportFile report file path @param { string } file screenshot file path @param { string } dir screenshot directory path @param { !Object } record screenshot diff results record
function reportRecord(reportFile, file, dir, record) {
  function thumb(file) {
    file = file.replace(dir + '/', '');
    return '<a class=thumb target=_blank href="' + file + '">' +
        '<img src="' + file + '">' +
        '</a>';
  }
  fs.appendFileSync(reportFile,
      '<tr>' +
      '<td>' + file + '</td>' +
      '<td><div class="result ' +
          (record.disparity > 0 ? 'error' : 'success') + '">' +
          record.disparity + '</div></td>' +
      '<td align=center>' + thumb(record.referenceImage) + '</td>' +
      '<td align=center>' + thumb(record.compareImage) + '</td>' +
      '<td align=center>' + thumb(record.differenceMap) + '</td>' +
      '</tr>',
      'utf8');
}
function reportRecord ( reportFile , file , dir , record ) { function thumb ( file ) { file = file . replace ( dir + '/' , '' ) ; return '<a class=thumb target=_blank href="' + file + '">' + '<img src="' + file + '">' + '</a>' ; } fs . appendFileSync ( reportFile , '<tr>' + '<td>' + file + '</td>' + '<td><div class="result ' + ( record . disparity > 0 ? 'error' : 'success' ) + '">' + record . disparity + '</div></td>' + '<td align=center>' + thumb ( record . referenceImage ) + '</td>' + '<td align=center>' + thumb ( record . compareImage ) + '</td>' + '<td align=center>' + thumb ( record . differenceMap ) + '</td>' + '</tr>' , 'utf8' ) ; }
Create an html report record for an image diff and add it to the report file
 @param {string} reportFile report file path
 @param {string} file screenshot file path
 @param {string} dir screenshot directory path
 @param {!Object} record screenshot diff results record
Create an html report record for an image diff and add it to the report file @param { string } reportFile report file path @param { string } file screenshot file path @param { string } dir screenshot directory path @param { !Object } record screenshot diff results record
/**
   * Create html for a thumbnail link
   * @param {string} file file path to a thumbnail image
   * @return {string} html anchor tag string
   */