B2G/gecko/toolkit/components/places/tests/browser/browser_colorAnalyzer.js
/**
 * Passes the given uri to findRepresentativeColor.
 * If expected is null, you expect it to fail.
 * If expected is a function, it will call that function.
 * If expected is a color, you expect that color to be returned.
 * Message is used in the calls to is().
 */
Passes the given uri to findRepresentativeColor.
If expected is null, you expect it to fail.
If expected is a function, it will call that function.
If expected is a color, you expect that color to be returned.
Message is used in the calls to is().
Passes the given uri to findRepresentativeColor . If expected is null you expect it to fail . If expected is a function it will call that function . If expected is a color you expect that color to be returned . Message is used in the calls to is () .
function frcTest(uri, expected, message, skipNextStep) {
  CA.findRepresentativeColor(Services.io.newURI(uri, "", null),
    function(success, color) {
      if (expected == null) {
        ok(!success, message);
      } else if (typeof expected == "function") {
        expected(color, message);
      } else {
        ok(success, "success: " + message);
        is(color, expected, message);
      }
      if (!skipNextStep) {
        nextStep();
      }
    }
  );
}
function frcTest ( uri , expected , message , skipNextStep ) { CA . findRepresentativeColor ( Services . io . newURI ( uri , "" , null ) , function ( success , color ) { if ( expected == null ) { ok ( ! success , message ) ; } else if ( typeof expected == "function" ) { expected ( color , message ) ; } else { ok ( success , "success: " + message ) ; is ( color , expected , message ) ; } if ( ! skipNextStep ) { nextStep ( ) ; } } ) ; }
Passes the given uri to findRepresentativeColor.
Passes the given uri to findRepresentativeColor .