From 2c8192b3298024c8243ec0ca713941b7f1ef9ffe Mon Sep 17 00:00:00 2001 From: Fernando Bunn Date: Wed, 8 Feb 2023 13:38:54 +0000 Subject: [PATCH] Add tests for gpcHeaderEnabledSites (#72) * 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 --- global-privacy-control/README.md | 4 ++++ global-privacy-control/tests.json | 35 +++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/global-privacy-control/README.md b/global-privacy-control/README.md index 85394af..e773784 100644 --- a/global-privacy-control/README.md +++ b/global-privacy-control/README.md @@ -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. \ No newline at end of file diff --git a/global-privacy-control/tests.json b/global-privacy-control/tests.json index 5a9f5c1..4dc9c60 100644 --- a/global-privacy-control/tests.json +++ b/global-privacy-control/tests.json @@ -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/", @@ -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/",