gecko-dev/testing/web-platform/tests/feature-policy
Dominic Farolino 40b01f37bf Bug 1638117 [wpt PR 23613] - Remove kLazyLoad and kLoadingFrameDefaultEager feature policies, a=testonly
Automatic update from web-platform-tests
Remove kLazyLoad and kLoadingFrameDefaultEager feature policies

Bug: 1079372
Change-Id: Ie1a116405cf89a4fa07e1716ec36170c75ba55fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2190034
Commit-Queue: Dominic Farolino <dom@chromium.org>
Reviewed-by: Ian Clelland <iclelland@chromium.org>
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774844}

--

wpt-commits: 7810613a0254e37a268cbf20058c4a249daa5ecc
wpt-pr: 23613
2020-06-12 09:18:34 +00:00
..
experimental-features Bug 1638117 [wpt PR 23613] - Remove kLazyLoad and kLoadingFrameDefaultEager feature policies, a=testonly 2020-06-12 09:18:34 +00:00
feature-policy-for-sandbox Bug 1637126 [wpt PR 23522] - Fix test time out on feature-propagation-to-auxiliary-context.html, a=testonly 2020-05-25 14:32:33 +00:00
reporting
resources Bug 1639938 [wpt PR 23731] - Reduce cross frame messages in feature-policy-nested-subframe-policy.https.sub.html, a=testonly 2020-05-29 20:22:18 +00:00
feature-policy-frame-policy-allowed-for-all.https.sub.html
feature-policy-frame-policy-allowed-for-all.https.sub.html.sub.headers
feature-policy-frame-policy-allowed-for-self.https.sub.html
feature-policy-frame-policy-allowed-for-self.https.sub.html.sub.headers
feature-policy-frame-policy-allowed-for-some-override.https.sub.html Bug 1634807 [wpt PR 23344] - Split feature-policy-frame-policy-allowed-for-some.https.sub.html, a=testonly 2020-05-20 10:27:56 +00:00
feature-policy-frame-policy-allowed-for-some-override.https.sub.html.sub.headers Bug 1634807 [wpt PR 23344] - Split feature-policy-frame-policy-allowed-for-some.https.sub.html, a=testonly 2020-05-20 10:27:56 +00:00
feature-policy-frame-policy-allowed-for-some.https.sub.html Bug 1634807 [wpt PR 23344] - Split feature-policy-frame-policy-allowed-for-some.https.sub.html, a=testonly 2020-05-20 10:27:56 +00:00
feature-policy-frame-policy-allowed-for-some.https.sub.html.sub.headers
feature-policy-frame-policy-disallowed-for-all.https.sub.html
feature-policy-frame-policy-disallowed-for-all.https.sub.html.sub.headers
feature-policy-frame-policy-timing-iframe-camera.https.sub.html
feature-policy-frame-policy-timing.https.sub.html
feature-policy-header-policy-allowed-for-all.https.sub.html
feature-policy-header-policy-allowed-for-all.https.sub.html.sub.headers
feature-policy-header-policy-allowed-for-self.https.sub.html
feature-policy-header-policy-allowed-for-self.https.sub.html.sub.headers
feature-policy-header-policy-allowed-for-some.https.sub.html
feature-policy-header-policy-allowed-for-some.https.sub.html.sub.headers
feature-policy-header-policy-declined.https.sub.html
feature-policy-header-policy-declined.https.sub.html.sub.headers
feature-policy-header-policy-disallowed-for-all.https.sub.html
feature-policy-header-policy-disallowed-for-all.https.sub.html.sub.headers
feature-policy-nested-header-policy-allowed-for-all.https.sub.html Bug 1639209 [wpt PR 23688] - Fix flaky test feature-policy-nested-header-policy-allowed-for-all.https.sub.html, a=testonly 2020-05-27 11:40:40 +00:00
feature-policy-nested-header-policy-allowed-for-all.https.sub.html.sub.headers
feature-policy-nested-header-policy-allowed-for-self.https.sub.html
feature-policy-nested-header-policy-allowed-for-self.https.sub.html.sub.headers
feature-policy-nested-header-policy-disallowed-for-all.https.sub.html
feature-policy-nested-header-policy-disallowed-for-all.https.sub.html.sub.headers
idlharness.window.js Bug 1635141 [wpt PR 23385] - Mark some idlharness.html tests as timeout=long, a=testonly 2020-05-20 10:28:04 +00:00
META.yml
payment-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html
payment-allowed-by-feature-policy-attribute.https.sub.html
payment-allowed-by-feature-policy.https.sub.html
payment-allowed-by-feature-policy.https.sub.html.headers
payment-default-feature-policy.https.sub.html
payment-disabled-by-feature-policy.https.sub.html
payment-disabled-by-feature-policy.https.sub.html.headers
payment-supported-by-feature-policy.tentative.html
picture-in-picture-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html
picture-in-picture-allowed-by-feature-policy-attribute.https.sub.html
picture-in-picture-allowed-by-feature-policy.https.sub.html
picture-in-picture-allowed-by-feature-policy.https.sub.html.headers
picture-in-picture-default-feature-policy.https.sub.html
picture-in-picture-disabled-by-feature-policy.https.sub.html
picture-in-picture-disabled-by-feature-policy.https.sub.html.headers
picture-in-picture-supported-by-feature-policy.html
policy-extends-to-sandbox.html
README.md

Feature Policy Guide

How to Test a New Feature with Feature Policy

This directory contains a framework to test features with feature policy.

When adding a new feature to feature policy, the following cases should be tested:

  • feature enabled by header policy [HTTP tests]
    • test when feature is enabled by feature policy HTTP headerr;
  • feature disabled by header policy [HTTP tests]
    • test when feature is disabled by feature policy HTTP header;
  • feature enabled on self origin by header policy [HTTP tests]
    • test when feature is enabled only on self origin by feature policy HTTP header.
  • feature allowed by container policy (iframe "allow" attribute);
    • test when feature is enabled by iframe "allow" attribute on self and cross origins.
  • feature allowed by container policy, redirect on load.
    • test when feature is enabled by iframe "allow" attribute when the iframe is being redirected to a new origin upon loading

How to Use the Test Framework

Use test_feature_availability() defined in /feature-policy/resources/featurepolicy.js. Please refer to the comments in /feature-policy/resources/featurepolicy.js for how this function works.

How to Write Header Policy Tests

HTTP tests are used to test features with header policy.

  • Define the header policy in <feature-name>-<enabled | disabled | enabled-on-self-origin>-by-feature-policy.https.sub.html.headers. Example:

    Feature-Policy: feature-name *

  • In <feature-name>-<enabled | disabled | enabled-on-self-origin>-by-feature-policy.https.sub.html:

  • test if feature is enabled / disabled in the main frame;

  • test if feature is enabled / disabled in a same-origin iframe;

  • test if feature is enabled / disabled in a cross-origin iframe.

Examples: /feature-policy/payment-disabled-by-feature-policy.https.sub.html /feature-policy/payment-disabled-by-feature-policy.https.sub.html.headers

How to Write Container Policy Tests

Simply use test_feature_availability() with the optional argument feature_name specified to test if:

  • feature is enabled / disabled in a same-origin iframe;
  • feature is enabled / disabled in a cross-origin iframe.

Example: /feature-policy/payment-allowed-by-feature-policy-attribute.https.sub.html

How to Write Container Policy Tests with Redirect

Similar to the section above, append /feature-policy/resources/redirect-on-load.html# to the argument src passed to test_feature_availability().

Example: /feature-policy/payment-allowed-by-feature-policy-attribute-redirect-on-load.https.sub.html