Skip to content

Migrate ambient-light header files from Feature-Policy to Permissions-Policy#58318

Merged
Honry merged 4 commits intomasterfrom
pp-migration-ambient-light
Mar 11, 2026
Merged

Migrate ambient-light header files from Feature-Policy to Permissions-Policy#58318
Honry merged 4 commits intomasterfrom
pp-migration-ambient-light

Conversation

@marcoscaceres
Copy link
Copy Markdown
Contributor

@marcoscaceres marcoscaceres commented Mar 6, 2026

Update header files to use Permissions-Policy header instead of the deprecated Feature-Policy header.

…-Policy

Update header files to use Permissions-Policy header instead of the deprecated
Feature-Policy header.
@marcoscaceres marcoscaceres changed the title Migrate ambient-light header files from Feature-Policy to Permissions… Migrate ambient-light header files from Feature-Policy to Permissions-Policy Mar 6, 2026
@marcoscaceres marcoscaceres requested a review from Copilot March 6, 2026 13:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-sensor is listed in document.permissionsPolicy.features() and removed the legacy document.featurePolicy version.
  • Added new .headers files using Permissions-Policy for allow-all / self / none cases, and removed the corresponding Feature-Policy .headers.
  • Updated several ambient-light tests to reference Permissions-Policy terminology 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.js here is incompatible with the generic-sensor-feature-policy-test.sub.js helper 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.js or 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.js here is incompatible with the generic-sensor-feature-policy-test.sub.js helper (it expects {enabled: ...} messages from /feature-policy/resources/...), so these async tests will wait forever. Use /feature-policy/resources/featurepolicy.js or 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.js but still uses generic-sensor-feature-policy-test.sub.js (Feature Policy helper) which posts {enabled: ...} from /feature-policy/resources/.... Since permissions-policy.js only handles {type:'availability-result', ...} messages, the test will time out. Either revert to /feature-policy/resources/featurepolicy.js or 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 calls run_fp_tests_* from generic-sensor-feature-policy-test.sub.js, which loads /feature-policy/resources/feature-policy-generic-sensor.html and expects { enabled: ... } messages. permissions-policy.js only completes when it receives a { type: 'availability-result', ... } message, so these tests will hang/time out. Either keep using /feature-policy/resources/featurepolicy.js here, or port the generic-sensor helper/resource pages to the permissions-policy message format and update the helper’s same_origin_src/base_src paths 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.js is incompatible with generic-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. Use featurepolicy.js here 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.

@reillyeon
Copy link
Copy Markdown
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.

Copy link
Copy Markdown
Contributor

@Honry Honry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@Honry Honry merged commit a57e0e8 into master Mar 11, 2026
25 checks passed
@Honry Honry deleted the pp-migration-ambient-light branch March 11, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants