diff --git a/tracker-radar-tests/TR-domain-matching/tracker_allowlist_matching_tests.json b/tracker-radar-tests/TR-domain-matching/tracker_allowlist_matching_tests.json index 191c3bba..d9e91838 100644 --- a/tracker-radar-tests/TR-domain-matching/tracker_allowlist_matching_tests.json +++ b/tracker-radar-tests/TR-domain-matching/tracker_allowlist_matching_tests.json @@ -150,5 +150,149 @@ "site": "https://testsite.com", "request": "http://a.b.c.videos.allowlist-tracker-2.com/a.js", "isAllowlisted": true + }, + { + "name": "format.test - supports unescaped slashes", + "site": "https://example.com", + "request": "https://format.test/test1.js", + "isAllowlisted": true + }, + { + "name": "format.test - supports simple regexp - matching request", + "site": "https://example.com", + "request": "https://format.test/1/test2.js", + "isAllowlisted": true + }, + { + "name": "format.test - supports simple regexp - nonmatching request", + "site": "https://example.com", + "request": "https://format.test/a/test2.js", + "isAllowlisted": false + }, + { + "name": "format.test - supports simple wildcard regexp - matching request", + "site": "https://example.com", + "request": "https://format.test/abc/test3.js", + "isAllowlisted": true + }, + { + "name": "format.test - supports simple wildcard regexp - nonmatching request", + "site": "https://example.com", + "request": "https://format.test/abc/test3a.js", + "isAllowlisted": false + }, + { + "name": "format.test - supports CBR regexp - matching request (1)", + "site": "https://example.com", + "request": "https://format.test/aa123b.cdeffffg/test2b.js", + "isAllowlisted": true + }, + { + "name": "format.test - supports CBR regexp - matching request (2)", + "site": "https://example.com", + "request": "https://format.test/ab.cd/test2b.js", + "isAllowlisted": true + }, + { + "name": "format.test - supports CBR regexp - nonmatching request (1)", + "site": "https://example.com", + "request": "https://format.test/aa123b.cffffg/test2b.js", + "isAllowlisted": false + }, + { + "name": "format.test - supports CBR regexp - nonmatching request (2)", + "site": "https://example.com", + "request": "https://format.test/ab1cd/test2b.js", + "isAllowlisted": false + }, + { + "name": "format.test - with subdomain - match on sub subdomain", + "site": "https://example.com", + "request": "https://sub0.sub1.sub2.format.test/test4.js", + "isAllowlisted": true + }, + { + "name": "format.test - with subdomain - don't match on just lower subdomain", + "site": "https://example.com", + "request": "https://sub1.format.test/test4.js", + "isAllowlisted": false + }, + { + "name": "format.test - with subdomain - match on full subdomain", + "site": "https://example.com", + "request": "https://sub1.sub2.format.test/test4.js", + "isAllowlisted": true + }, + { + "name": "format.test - with subdomain - don't match for incorrect subdomain", + "site": "https://example.com", + "request": "https://sub1nsub2.format.test/test4.js", + "isAllowlisted": false + }, + { + "name": "format.test - with subdomain - don't match on incorrect subdomain", + "site": "https://example.com", + "request": "https://sub0.sub2.format.test/test4.js", + "isAllowlisted": false + }, + { + "name": "format.test - with subdomain and regexp - match on sub subdomain", + "site": "https://example.com", + "request": "https://sub0.sub1.sub2.format.test/a/test4a.js", + "isAllowlisted": true + }, + { + "name": "format.test - with subdomain and regexp - don't match on just lower subdomain", + "site": "https://example.com", + "request": "https://sub1.format.test/a/test4a.js", + "isAllowlisted": false + }, + { + "name": "format.test - with subdomain and regexp - match on full subdomain", + "site": "https://example.com", + "request": "https://sub1.sub2.format.test/a/test4a.js", + "isAllowlisted": true + }, + { + "name": "format.test - with subdomain and regexp - don't match for incorrect subdomain", + "site": "https://example.com", + "request": "https://sub1nsub2.format.test/a/test4a.js", + "isAllowlisted": false + }, + { + "name": "format.test - with subdomain and regexp - don't match on incorrect subdomain", + "site": "https://example.com", + "request": "https://sub0.sub2.format.test/a/test4a.js", + "isAllowlisted": false + }, + { + "name": "format.test - domain in rule - match on full request", + "site": "https://example.com", + "request": "https://sub1.format.test/sub2.format.test/test4b.js", + "isAllowlisted": true + }, + { + "name": "format.test - domain in rule - don't match the inner request", + "site": "https://example.com", + "request": "https://sub2.format.test/test4b.js", + "isAllowlisted": false + }, + { + "name": "format.test - no escape on domain - matching request", + "site": "https://example.com", + "request": "https://format.test/test5.js", + "isAllowlisted": true + }, + { + "name": "format.test - no escape on subdomain - match with periods", + "site": "https://example.com", + "request": "https://sub1.sub2.format.test/test6.js", + "isAllowlisted": true + }, + { + "name": "format.test - no escape on subdomain - match with replacements", + "site": "https://example.com", + "request": "https://sub1asub2.format.test/test6.js", + "isAllowlisted": true } ] diff --git a/tracker-radar-tests/TR-domain-matching/tracker_allowlist_reference.json b/tracker-radar-tests/TR-domain-matching/tracker_allowlist_reference.json index 6793559c..d5031de9 100644 --- a/tracker-radar-tests/TR-domain-matching/tracker_allowlist_reference.json +++ b/tracker-radar-tests/TR-domain-matching/tracker_allowlist_reference.json @@ -25,6 +25,11 @@ "domains": [""], "reason": "match all sites and all paths" }, + { + "rule": "allowlist-tracker-2.com/login.js", + "domains": [""], + "reason": "match single resource on all sites" + }, { "rule": "allowlist-tracker-2.com/login.js", "domains": [""], @@ -40,6 +45,55 @@ "reason": "match all requests" } ] + }, + "format.test": { + "rules": [ + { + "rule": "format\\.test/test1\\.js", + "reason": "Unescaped slash should be allowed.", + "domains": [""] + }, + { + "rule": "format\\.test/[0-9]+/test2\\.js", + "reason": "Simple regexp", + "domains": [""] + }, + { + "rule": "format\\.test/.*/test3\\.js", + "reason": "Simple regexp wildcard", + "domains": [""] + }, + { + "rule": "format\\.test/a.*.\\.[c]([de]+)f*g?/test2b\\.js", + "reason": "Simple regexp (full CBR), see https://developer.apple.com/documentation/safariservices/creating_a_content_blocker#3030754", + "domains": [""] + }, + { + "rule": "sub1\\.sub2\\.format\\.test/test4\\.js", + "reason": "With subdomain", + "domains": [""] + }, + { + "rule": "sub1\\.sub2\\.format\\.test/[abc]/test4a\\.js", + "reason": "With subdomain and regexp", + "domains": [""] + }, + { + "rule": "sub1\\.format\\.test/sub2\\.format\\.test/test4b\\.js", + "reason": "Domain in rule", + "domains": [""] + }, + { + "rule": "format.test/test5\\.js", + "reason": "No escape on the domain.", + "domains": [""] + }, + { + "rule": "sub1.sub2.format.test/test6\\.js", + "reason": "No escape on the domain with subdomain.", + "domains": [""] + } + ] } } diff --git a/tracker-radar-tests/TR-domain-matching/tracker_allowlist_tds_reference.json b/tracker-radar-tests/TR-domain-matching/tracker_allowlist_tds_reference.json index 14f7f65d..513243ee 100644 --- a/tracker-radar-tests/TR-domain-matching/tracker_allowlist_tds_reference.json +++ b/tracker-radar-tests/TR-domain-matching/tracker_allowlist_tds_reference.json @@ -41,6 +41,18 @@ "cookies": 0.1, "categories": [], "default": "block" + }, + "format.test": { + "domain": "format.test", + "owner": { + "name": "Tests for formatting", + "displayName": "Tests for formatting" + }, + "prevalence": 0.1, + "fingerprinting": 3, + "cookies": 0.1, + "categories": [], + "default": "block" } }, "entities": { @@ -52,6 +64,13 @@ ], "prevalence": 0.1, "displayName": "Test Site for Tracker Blocking" + }, + "Tests for formatting": { + "domains": [ + "format.test" + ], + "prevalence": 0.1, + "displayName": "Tests for formatting" } }, "cnames": { @@ -60,6 +79,7 @@ "domains": { "allowlist-tracker-1.com": "Test Site for Tracker Blocking", "allowlist-tracker-2.com": "Test Site for Tracker Blocking", - "allowlist-tracker-3.com": "Test Site for Tracker Blocking" + "allowlist-tracker-3.com": "Test Site for Tracker Blocking", + "format.test": "Tests for formatting" } }