Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for expecting ignore unknown surrogates #116

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions tracker-radar-tests/TR-domain-matching/domain_matching_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,62 @@
"expectAction": "redirect",
"expectRedirect": "data:application/javascript;base64,KGZ1bmN0aW9uKCkge3dpbmRvdy5zdXJyb2dhdGUxPXRydWV9KSgpOw==",
"expectExpression": "window.surrogate1 === true"
},
{
"name": "Encountering unknown surrogate with default:block should ignore",
"siteURL": "https://example.com",
"requestURL": "https://unknownsurrogates1.test/request1",
"requestType": "script",
"expectAction": "ignore"
},
{
"name": "Encountering unknown surrogate with default:ignore should ignore",
"siteURL": "https://example.com",
"requestURL": "https://unknownsurrogates2.test/request1",
"requestType": "script",
"expectAction": "ignore"
},
{
"name": "Encountering unknown surrogate with default:block and failing options check, should block",
"siteURL": "https://example.com",
"requestURL": "https://unknownsurrogates1.test/request2",
"requestType": "script",
"expectAction": "block"
},
{
"name": "Encountering unknown surrogate with default:block and successful options check, should ignore",
"siteURL": "https://selectedsite1.com",
"requestURL": "https://unknownsurrogates1.test/request2",
"requestType": "script",
"expectAction": "ignore"
},
{
"name": "Encountering unknown surrogate with default:ignore and failing options check, should ignore",
"siteURL": "https://example.com",
"requestURL": "https://unknownsurrogates2.test/request2",
"requestType": "script",
"expectAction": "ignore"
},
{
"name": "Encountering unknown surrogate with default:ignore and successful options check, should ignore",
"siteURL": "https://selectedsite1.com",
"requestURL": "https://unknownsurrogates2.test/request2",
"requestType": "script",
"expectAction": "ignore"
},
{
"name": "Encountering unknown surrogate with exemption (default:block) should ignore",
"siteURL": "https://exemptedsite1.com",
"requestURL": "https://unknownsurrogates1.test/request1",
"requestType": "script",
"expectAction": "ignore"
},
{
"name": "Encountering unknown surrogate with exemption (default:ignore) should ignore",
"siteURL": "https://exemptedsite1.com",
"requestURL": "https://unknownsurrogates2.test/request1",
"requestType": "script",
"expectAction": "ignore"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,74 @@
],
"default": "block"
},
"unknownsurrogates1.test": {
"domain": "unknownsurrogates1.test",
"owner": {
"name": "Test Site for Surrogates",
"displayName": "Surrogates Site",
"privacyPolicy": "",
"url": "http://blockedsurrogates.test"
},
"prevalence": 0.1,
"fingerprinting": 3,
"cookies": 0.1,
"categories": [],
"rules": [
{
"rule": "unknownsurrogates1\\.test/request1",
"surrogate": "unknownsurrogate1",
"exceptions": {
"domains": [
"exemptedsite1.com"
]
}
},
{
"rule": "unknownsurrogates1\\.test/request2",
"surrogate": "unknownsurrogate1",
"options": {
"domains": [
"selectedsite1.com"
]
}
}
],
"default": "block"
},
"unknownsurrogates2.test": {
"domain": "unknownsurrogates2.test",
"owner": {
"name": "Test Site for Surrogates",
"displayName": "Surrogates Site",
"privacyPolicy": "",
"url": "http://blockedsurrogates.test"
},
"prevalence": 0.1,
"fingerprinting": 3,
"cookies": 0.1,
"categories": [],
"rules": [
{
"rule": "unknownsurrogates2\\.test/request1",
"surrogate": "unknownsurrogate2",
"exceptions": {
"domains": [
"exemptedsite1.com"
]
}
},
{
"rule": "unknownsurrogates2\\.test/request2",
"surrogate": "unknownsurrogate2",
"options": {
"domains": [
"selectedsite1.com"
]
}
}
],
"default": "ignore"
},
"format.test": {
"domain": "format.test",
"owner": {
Expand Down Expand Up @@ -861,7 +929,9 @@
"domains": [
"other-surrogates.test",
"surrogates.test",
"blockedsurrogates.test"
"blockedsurrogates.test",
"unknownsurrogates1.test",
"unknownsurrogates2.test"
],
"prevalence": 0.1,
"displayName": "Test Site for Surrogates"
Expand Down Expand Up @@ -896,6 +966,8 @@
"sub.ignore.test": "Ignore Site for Tracker Blocking",
"surrogates.test": "Test Site for Surrogates",
"other-surrogates.test": "Test Site for Surrogates",
"blockedsurrogates.test": "Test Site for Surrogates"
"blockedsurrogates.test": "Test Site for Surrogates",
"unknownsurrogates1.test": "Test Site for Surrogates",
"unknownsurrogates2.test": "Test Site for Surrogates"
}
}
Loading