Skip to content

Commit

Permalink
Add tests for expecting ignore unknown surrogates
Browse files Browse the repository at this point in the history
  • Loading branch information
GuiltyDolphin committed Nov 8, 2023
1 parent 7519c3d commit bc89be8
Show file tree
Hide file tree
Showing 2 changed files with 130 additions and 2 deletions.
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"
}
}

0 comments on commit bc89be8

Please sign in to comment.