B2G/gecko/toolkit/components/url-classifier/tests/unit/test_addsub.js
// Same as testSimpleSub(), but the sub comes in before the add.
Same as testSimpleSub(), but the sub comes in before the add.
Same as testSimpleSub () but the sub comes in before the add .
function testSubEmptiesAdd()
{
  var subUrls = ["1:foo.com/a"];
  var addUrls = ["foo.com/a", "bar.com/b"];
  var subUpdate = buildPhishingUpdate(
    [{ "chunkNum" : 50,
       "chunkType" : "s",
       "urls": subUrls }]);
  var addUpdate = buildPhishingUpdate(
    [{ "chunkNum" : 1,
       "urls": addUrls }]);
  var assertions = {
    "tableData" : "test-phish-simple;a:1:s:50",
    "urlsExist" : [ "bar.com/b" ],
    "urlsDontExist": ["foo.com/a" ],
    "subsDontExist" : [ "foo.com/a" ] 
  }
  doTest([subUpdate, addUpdate], assertions);
}
function testSubEmptiesAdd ( ) { var subUrls = [ "1:foo.com/a" ] ; var addUrls = [ "foo.com/a" , "bar.com/b" ] ; var subUpdate = buildPhishingUpdate ( [ { "chunkNum" : 50 , "chunkType" : "s" , "urls" : subUrls } ] ) ; var addUpdate = buildPhishingUpdate ( [ { "chunkNum" : 1 , "urls" : addUrls } ] ) ; var assertions = { "tableData" : "test-phish-simple;a:1:s:50" , "urlsExist" : [ "bar.com/b" ] , "urlsDontExist" : [ "foo.com/a" ] , "subsDontExist" : [ "foo.com/a" ] } doTest ( [ subUpdate , addUpdate ] , assertions ) ; }
Same as testSimpleSub(), but the sub comes in before the add.
Same as testSimpleSub () but the sub comes in before the add .
// this sub was found, it shouldn't exist anymore