B2G/gecko/toolkit/components/url-classifier/tests/unit/test_addsub.js
// Make sure that the sub url removes from only the chunk that it specifies
Make sure that the sub url removes from only the chunk that it specifies
Make sure that the sub url removes from only the chunk that it specifies
function testDuplicateAdds()
{
  var urls = ["foo.com/a"];
  var addUpdate1 = buildPhishingUpdate(
    [{ "chunkNum" : 1,
       "urls": urls }]);
  var addUpdate2 = buildPhishingUpdate(
    [{ "chunkNum" : 2,
       "urls": urls }]);
  var subUpdate = buildPhishingUpdate(
    [{ "chunkNum" : 3,
       "chunkType" : "s",
       "urls": ["2:foo.com/a"]}]);
  var assertions = {
    "tableData" : "test-phish-simple;a:1-2:s:3",
    "urlsExist" : [ "foo.com/a"],
    "subsDontExist" : [ "foo.com/a"]
  }
  doTest([addUpdate1, addUpdate2, subUpdate], assertions);
}
function testDuplicateAdds ( ) { var urls = [ "foo.com/a" ] ; var addUpdate1 = buildPhishingUpdate ( [ { "chunkNum" : 1 , "urls" : urls } ] ) ; var addUpdate2 = buildPhishingUpdate ( [ { "chunkNum" : 2 , "urls" : urls } ] ) ; var subUpdate = buildPhishingUpdate ( [ { "chunkNum" : 3 , "chunkType" : "s" , "urls" : [ "2:foo.com/a" ] } ] ) ; var assertions = { "tableData" : "test-phish-simple;a:1-2:s:3" , "urlsExist" : [ "foo.com/a" ] , "subsDontExist" : [ "foo.com/a" ] } doTest ( [ addUpdate1 , addUpdate2 , subUpdate ] , assertions ) ; }
Make sure that the sub url removes from only the chunk that it specifies
Make sure that the sub url removes from only the chunk that it specifies