Migrate ambient-light header files from Feature-Policy to Permissions-Policy#58318
Merged
Migrate ambient-light header files from Feature-Policy to Permissions-Policy#58318
Conversation
…-Policy Update header files to use Permissions-Policy header instead of the deprecated Feature-Policy header.
10 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR migrates the ambient-light WPT coverage from the deprecated Feature-Policy header to the Permissions-Policy header, updating/adding the corresponding test and .headers files.
Changes:
- Added a new test verifying
ambient-light-sensoris listed indocument.permissionsPolicy.features()and removed the legacydocument.featurePolicyversion. - Added new
.headersfiles usingPermissions-Policyfor allow-all / self / none cases, and removed the correspondingFeature-Policy.headers. - Updated several ambient-light tests to reference
Permissions-Policyterminology and a different policy helper script.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| ambient-light/AmbientLightSensor-supported-by-permissions-policy.html | New test asserting ambient-light-sensor appears in document.permissionsPolicy.features(). |
| ambient-light/AmbientLightSensor-supported-by-feature-policy.html | Removed legacy document.featurePolicy.features() test. |
| ambient-light/AmbientLightSensor-enabled-on-self-origin-by-permissions-policy.https.html.headers | New Permissions-Policy header for self-origin allowlist. |
| ambient-light/AmbientLightSensor-enabled-on-self-origin-by-permissions-policy.https.html | Updated test page to reference Permissions Policy and import different helper script. |
| ambient-light/AmbientLightSensor-enabled-on-self-origin-by-feature-policy.https.html.headers | Removed legacy Feature-Policy header file. |
| ambient-light/AmbientLightSensor-enabled-by-permissions-policy.https.html.headers | New Permissions-Policy header for allow-all case. |
| ambient-light/AmbientLightSensor-enabled-by-permissions-policy.https.html | Updated test page to reference Permissions Policy and import different helper script. |
| ambient-light/AmbientLightSensor-enabled-by-permissions-policy-attribute.https.html | Updated test page to reference Permissions Policy and import different helper script. |
| ambient-light/AmbientLightSensor-enabled-by-permissions-policy-attribute-redirect-on-load.https.html | Updated test page to reference Permissions Policy and import different helper script. |
| ambient-light/AmbientLightSensor-enabled-by-feature-policy.https.html.headers | Removed legacy Feature-Policy header file. |
| ambient-light/AmbientLightSensor-disabled-by-permissions-policy.https.html.headers | New Permissions-Policy header for allow-none case. |
| ambient-light/AmbientLightSensor-disabled-by-permissions-policy.https.html | Updated test page to reference Permissions Policy and import different helper script. |
| ambient-light/AmbientLightSensor-disabled-by-feature-policy.https.html.headers | Removed legacy Feature-Policy header file. |
Comments suppressed due to low confidence (5)
ambient-light/AmbientLightSensor-enabled-by-permissions-policy-attribute.https.html:7
- Importing
/permissions-policy/resources/permissions-policy.jshere is incompatible with thegeneric-sensor-feature-policy-test.sub.jshelper that this test invokes (different postMessage format and iframe resource paths), which will cause the test to hang/time out. Either switch back to/feature-policy/resources/featurepolicy.jsor migrate the generic-sensor helper/resources to the permissions-policy harness and message format.
ambient-light/AmbientLightSensor-enabled-by-permissions-policy-attribute-redirect-on-load.https.html:7 - Importing
/permissions-policy/resources/permissions-policy.jshere is incompatible with thegeneric-sensor-feature-policy-test.sub.jshelper (it expects{enabled: ...}messages from/feature-policy/resources/...), so these async tests will wait forever. Use/feature-policy/resources/featurepolicy.jsor update the generic-sensor helper/resources to use the permissions-policy message format ({ type: 'availability-result', ... }).
ambient-light/AmbientLightSensor-disabled-by-permissions-policy.https.html:7 - This test imports
/permissions-policy/resources/permissions-policy.jsbut still usesgeneric-sensor-feature-policy-test.sub.js(Feature Policy helper) which posts{enabled: ...}from/feature-policy/resources/.... Sincepermissions-policy.jsonly handles{type:'availability-result', ...}messages, the test will time out. Either revert to/feature-policy/resources/featurepolicy.jsor migrate the generic-sensor helper/resources to the permissions-policy harness.
ambient-light/AmbientLightSensor-enabled-by-permissions-policy.https.html:7 - The test now imports
/permissions-policy/resources/permissions-policy.js, but it still callsrun_fp_tests_*fromgeneric-sensor-feature-policy-test.sub.js, which loads/feature-policy/resources/feature-policy-generic-sensor.htmland expects{ enabled: ... }messages.permissions-policy.jsonly completes when it receives a{ type: 'availability-result', ... }message, so these tests will hang/time out. Either keep using/feature-policy/resources/featurepolicy.jshere, or port the generic-sensor helper/resource pages to the permissions-policy message format and update the helper’ssame_origin_src/base_srcpaths accordingly.
ambient-light/AmbientLightSensor-enabled-on-self-origin-by-permissions-policy.https.html:7 - Same issue as other ambient-light tests: importing
/permissions-policy/resources/permissions-policy.jsis incompatible withgeneric-sensor-feature-policy-test.sub.js(it uses/feature-policy/resources/...and posts{enabled: ...}rather than{type:'availability-result', ...}), so the harness never receives the message it’s waiting for and the test will time out. Usefeaturepolicy.jshere or update the generic-sensor helper/resources to the permissions-policy message format.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
|
In the interest of consistent review, @Honry, please take a look at this and the related changes. Thank you Marcos for putting together this series. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update header files to use Permissions-Policy header instead of the deprecated Feature-Policy header.