Skip to content

Commit

Permalink
Add tests for gpcHeaderEnabledSites (#72)
Browse files Browse the repository at this point in the history
* Add tests for gpcHeaderEnabledSites

https://app.asana.com/0/1200606622205980/1203496117125023/f

* Add tests for platforms that don't implement gpcHeaderEnabledSites

* Improve test name description

* Remove android from gpcHeader specific tests

* Update readme

* Change documentation style
  • Loading branch information
Bunn authored Feb 8, 2023
1 parent 746c592 commit 2c8192b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
4 changes: 4 additions & 0 deletions global-privacy-control/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,7 @@ for $testSet in test.json
expect(getJSPropertyValue('Navigator.prototype.globalPrivacyControl') === $test.expectGPCAPIValue)
```

## Platform exceptions

- On platforms where header modifications is limited headers should only be modified on sites listed in gpcHeaderEnabledSites inside the settings of the gpc feature of the remote config.
35 changes: 35 additions & 0 deletions global-privacy-control/tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,33 @@
"expectGPCHeader": false,
"exceptPlatforms": []
},
{
"name": "Header not injected on platforms using gpcHeaderEnabledSites - domain is excluded from gpcHeaderEnabledSites",
"siteURL": "http://anotherexample.com",
"requestURL": "http://anotherexample.com",
"requestType": "main_frame",
"gpcUserSettingOn": true,
"expectGPCHeader": false,
"exceptPlatforms": [
"web-extension",
"safari-extension",
"windows-browser",
"android-browser"
]
},
{
"name": "Header injected on platforms not using gpcHeaderEnabledSites - domain is excluded from gpcHeaderEnabledSites",
"siteURL": "http://anotherexample.com",
"requestURL": "http://anotherexample.com",
"requestType": "main_frame",
"gpcUserSettingOn": true,
"expectGPCHeader": true,
"exceptPlatforms": [
"ios-browser",
"macos-browser",
"android-browser"
]
},
{
"name": "Header not injected - privacy config local exception (gpc/exceptions)",
"siteURL": "https://www.washingtonpost.com/",
Expand Down Expand Up @@ -101,6 +128,14 @@
"expectGPCAPI": true,
"exceptPlatforms": []
},
{
"name": "API injected - domain is excluded from gpcHeaderEnabledSites, JavaScript API should still work",
"siteURL": "http://anotherexample.com",
"gpcUserSettingOn": true,
"expectGPCAPI": true,
"expectGPCAPIValue": "true",
"exceptPlatforms": []
},
{
"name": "API NOT injected - excluded site (gpc/exceptions)",
"siteURL": "https://www.washingtonpost.com/",
Expand Down

0 comments on commit 2c8192b

Please sign in to comment.