diff --git a/privacy-configuration/README.MD b/privacy-configuration/README.MD index 679f196..9ffc54f 100644 --- a/privacy-configuration/README.MD +++ b/privacy-configuration/README.MD @@ -23,6 +23,7 @@ Test suite specific fields: - frameURL - string - URL of an iframe in which the feature is operating (optional - if not set assume main frame context) - scriptURL - string - URL of script that is trying to use a protected feature (optional - if not set assume no script URL) - expectFeatureEnabled - bool - if feature is expected to be disabled or not +- platformVersion - string - (optional) string to be considered as the testing platform's app version for use with `minSupportedVerison` tests ## Pseudo-code implementation @@ -35,7 +36,8 @@ for $testSet in test.json feature=$test.featureName, url=$test.siteURL, frame=$test.frameURL, - script=$test.scriptURL + script=$test.scriptURL, + platformVersion=$test.platformVersion? ) expect($enabled === $test.expectFeatureEnabled) diff --git a/privacy-configuration/config4_reference.json b/privacy-configuration/config4_reference.json new file mode 100644 index 0000000..0136157 --- /dev/null +++ b/privacy-configuration/config4_reference.json @@ -0,0 +1,12 @@ +{ + "readme": "This configuration's features have a minSupportedVersion", + "features": { + "contentBlocking": { + "state": "enabled", + "minSupportedVersion": "2022.6.1", + "exceptions": [] + } + }, + "version": 1635943904459, + "unprotectedTemporary": [] +} \ No newline at end of file diff --git a/privacy-configuration/tests.json b/privacy-configuration/tests.json index c9a97f9..eee8e5a 100644 --- a/privacy-configuration/tests.json +++ b/privacy-configuration/tests.json @@ -656,5 +656,28 @@ "exceptPlatforms": [] } ] + }, + "minSupportedVersion": { + "name": "Features are expected to be disabled if the platform version is too low", + "desc": "Those tests use config14reference.json where features contain a minSupportedVresion", + "referenceConfig": "config4_reference.json", + "tests": [ + { + "name": "Feature should be disabled if the platform version is too low", + "featureName": "contentBlocking", + "siteURL": "https://example.org", + "expectFeatureEnabled": false, + "platformVersion": "2022.5.30", + "exceptPlatforms": [] + }, + { + "name": "Feature should be enabled if the platform version is higher than the minSupportedVersion", + "featureName": "contentBlocking", + "siteURL": "https://example.org", + "expectFeatureEnabled": true, + "platformVersion": "2022.6.15", + "exceptPlatforms": [] + } + ] } } \ No newline at end of file