Opened 4 years ago

Closed 3 years ago

#3675 closed change (fixed)

[abp2blocklist] Add unittests

Reported by: sebastian Assignee: kzar
Priority: P3 Milestone:
Module: Platform Keywords:
Cc: kzar Blocked By: #3671
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29344540/

Description (last modified by kzar)

Background

With #3671, abp2blocklist provides a proper API. So we can finally start writing automated tests. We want to use Nodeunit as that is what we use for the adblockpluscore repository.

What to change

Introduce unittests, that run against the API introduced with #3671. The tests should be as granular as possible, and include at least following test cases:

  • Verify the order of generated blocking rules, regardless of the order in which the corresponding filters been passed to the API. The mandatory order is:
    1. Element hiding rules
    2. $elemhide exception rules
    3. Request blocking filters
    4. Other exception rules
  • Verify that Adblock Plus request type filter options are mapped correctly to the corresponding trigger.resource-type.
  • Verify that unsupported filter, like those using the $sitekey option, are ignored.
  • Verify that other filter options, including $domain, $third-party and $match_case, are converted correctly.
  • Verify that IDN domains are converted to punycode.
  • Verify that filters that use non-ASCI characters (that aren't converted as part of the domain) are removed from the resulting block list.
  • Verify that element hiding exceptions cause the respective element hiding filter to be removed from the generated block list.
  • Verify that ID selectors are replaced wit attribute selectors, see #3584.

Change History (9)

comment:1 Changed 4 years ago by sebastian

  • Description modified (diff)

comment:2 Changed 4 years ago by sebastian

  • Description modified (diff)

comment:3 Changed 4 years ago by sebastian

  • Description modified (diff)

comment:4 Changed 3 years ago by kzar

  • Owner set to kzar

comment:5 Changed 3 years ago by kzar

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:6 Changed 3 years ago by kzar

  • Description modified (diff)

comment:7 Changed 3 years ago by kzar

  • Description modified (diff)

comment:8 Changed 3 years ago by abpbot

A commit referencing this issue has landed:
Issue 3675 - Test ContentBlockerList

comment:9 Changed 3 years ago by kzar

  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.