B2G/gecko/toolkit/components/url-classifier/tests/unit/test_streamupdater.js
// Test a simple update with a valid message authentication code.
Test a simple update with a valid message authentication code.
Test a simple update with a valid message authentication code .
function testValidMAC() {
  var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
  var update = buildPhishingUpdate(
        [
          { "chunkNum" : 1,
            "urls" : addUrls
          }]);
  update = "m:" + MAC(update, gClientKeyRaw) + "\n" + update;
  var assertions = {
    "tableData" : "test-phish-simple;a:1",
    "urlsExist" : addUrls
  };
  doTest([update], assertions, false, gClientKey);
}
function testValidMAC ( ) { var addUrls = [ "foo.com/a" , "foo.com/b" , "bar.com/c" ] ; var update = buildPhishingUpdate ( [ { "chunkNum" : 1 , "urls" : addUrls } ] ) ; update = "m:" + MAC ( update , gClientKeyRaw ) + "\n" + update ; var assertions = { "tableData" : "test-phish-simple;a:1" , "urlsExist" : addUrls } ; doTest ( [ update ] , assertions , false , gClientKey ) ; }
Test a simple update with a valid message authentication code.
Test a simple update with a valid message authentication code .