B2G/gecko/toolkit/components/url-classifier/tests/unit/test_addsub.js
// Make sure that a saved sub is removed when the sub chunk is expired.
Make sure that a saved sub is removed when the sub chunk is expired.
Make sure that a saved sub is removed when the sub chunk is expired .
function testPendingSubExpire()
{
  var subUrls = ["1:foo.com/a", "1:foo.com/b"];
  var addUrls = ["foo.com/a", "foo.com/b"];
  var subUpdate = buildPhishingUpdate(
    [{ "chunkNum" : 1,
       "chunkType" : "s",
       "urls": subUrls }]);
  var expireUpdate = buildPhishingUpdate(
    [{ "chunkNum" : 1,
       "chunkType" : "sd" }]);
  var addUpdate = buildPhishingUpdate(
    [{ "chunkNum" : 1, 
       "urls": addUrls }]);
  var assertions = {
    "tableData" : "test-phish-simple;a:1",
    "urlsExist" : [ "foo.com/a", "foo.com/b" ],
    "subsDontExist" : [ "foo.com/a", "foo.com/b" ] 
  }
  doTest([subUpdate, expireUpdate, addUpdate], assertions);
}
function testPendingSubExpire ( ) { var subUrls = [ "1:foo.com/a" , "1:foo.com/b" ] ; var addUrls = [ "foo.com/a" , "foo.com/b" ] ; var subUpdate = buildPhishingUpdate ( [ { "chunkNum" : 1 , "chunkType" : "s" , "urls" : subUrls } ] ) ; var expireUpdate = buildPhishingUpdate ( [ { "chunkNum" : 1 , "chunkType" : "sd" } ] ) ; var addUpdate = buildPhishingUpdate ( [ { "chunkNum" : 1 , "urls" : addUrls } ] ) ; var assertions = { "tableData" : "test-phish-simple;a:1" , "urlsExist" : [ "foo.com/a" , "foo.com/b" ] , "subsDontExist" : [ "foo.com/a" , "foo.com/b" ] } doTest ( [ subUpdate , expireUpdate , addUpdate ] , assertions ) ; }
Make sure that a saved sub is removed when the sub chunk is expired.
Make sure that a saved sub is removed when the sub chunk is expired .
// adds and subtracts don't share a chunk numbering space // this sub was expired