B2G/gecko/toolkit/components/places/tests/browser/browser_colorAnalyzer.js
/**
 * Handy function for getting an image into findRepresentativeColor and testing it.
 * Makes a canvas with the given dimensions, calls paintCanvasFunc with the 2d
 * context of the canvas, sticks the generated canvas into findRepresentativeColor.
 * See frcTest.
 */
Handy function for getting an image into findRepresentativeColor and testing it.
Makes a canvas with the given dimensions, calls paintCanvasFunc with the 2d
context of the canvas, sticks the generated canvas into findRepresentativeColor.
See frcTest.
Handy function for getting an image into findRepresentativeColor and testing it . Makes a canvas with the given dimensions calls paintCanvasFunc with the 2d context of the canvas sticks the generated canvas into findRepresentativeColor . See frcTest .
function canvasTest(width, height, paintCanvasFunc, expected, message, skipNextStep) {
  let canvas = hiddenWindowDoc.createElementNS(XHTML_NS, "canvas");
  canvas.width = width;
  canvas.height = height;
  paintCanvasFunc(canvas.getContext("2d"));
  let uri = canvas.toDataURL();
  frcTest(uri, expected, message, skipNextStep);
}
function canvasTest ( width , height , paintCanvasFunc , expected , message , skipNextStep ) { let canvas = hiddenWindowDoc . createElementNS ( XHTML_NS , "canvas" ) ; canvas . width = width ; canvas . height = height ; paintCanvasFunc ( canvas . getContext ( "2d" ) ) ; let uri = canvas . toDataURL ( ) ; frcTest ( uri , expected , message , skipNextStep ) ; }
Handy function for getting an image into findRepresentativeColor and testing it.
Handy function for getting an image into findRepresentativeColor and testing it .