B2G/gecko/toolkit/components/url-classifier/tests/unit/test_prefixset.js
// exists and to give a basic example of its use.
exists and to give a basic example of its use.
exists and to give a basic example of its use .
function testBasicPset() {
  let pset = Cc["@mozilla.org/url-classifier/prefixset;1"]
               .createInstance(Ci.nsIUrlClassifierPrefixSet);
  let prefixes = [2,50,100,2000,78000,1593203];
  pset.setPrefixes(prefixes, prefixes.length);
  do_check_true(wrappedProbe(pset, 100));
  do_check_false(wrappedProbe(pset, 100000));
  do_check_true(wrappedProbe(pset, 1593203));
  do_check_false(wrappedProbe(pset, 999));
  do_check_false(wrappedProbe(pset, 0));
  checkContents(pset, prefixes);
}
function testBasicPset ( ) { let pset = Cc [ "@mozilla.org/url-classifier/prefixset;1" ] . createInstance ( Ci . nsIUrlClassifierPrefixSet ) ; let prefixes = [ 2 , 50 , 100 , 2000 , 78000 , 1593203 ] ; pset . setPrefixes ( prefixes , prefixes . length ) ; do_check_true ( wrappedProbe ( pset , 100 ) ) ; do_check_false ( wrappedProbe ( pset , 100000 ) ) ; do_check_true ( wrappedProbe ( pset , 1593203 ) ) ; do_check_false ( wrappedProbe ( pset , 999 ) ) ; do_check_false ( wrappedProbe ( pset , 0 ) ) ; checkContents ( pset , prefixes ) ; }
exists and to give a basic example of its use.
exists and to give a basic example of its use .