Opened on 02/21/2016 at 09:14:44 PM

Closed on 05/26/2016 at 08:20:29 AM

#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.

Attachments (0)

Change History (9)

comment:1 Changed on 02/21/2016 at 09:15:36 PM by sebastian

  • Description modified (diff)

comment:2 Changed on 02/21/2016 at 09:16:34 PM by sebastian

  • Description modified (diff)

comment:3 Changed on 02/21/2016 at 09:18:24 PM by sebastian

  • Description modified (diff)

comment:4 Changed on 05/25/2016 at 11:44:25 AM by kzar

  • Owner set to kzar

comment:5 Changed on 05/25/2016 at 04:22:30 PM by kzar

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

comment:6 Changed on 05/25/2016 at 06:17:19 PM by kzar

  • Description modified (diff)

comment:7 Changed on 05/25/2016 at 06:17:41 PM by kzar

  • Description modified (diff)

comment:8 Changed on 05/26/2016 at 08:19:19 AM by abpbot

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

comment:9 Changed on 05/26/2016 at 08:20:29 AM by kzar

  • Resolution set to fixed
  • Status changed from reviewing to closed

Add Comment

Modify Ticket

Change Properties
Action
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from kzar.
 
Note: See TracTickets for help on using tickets.