forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature Policy JS API Update: Add document.featurePolicy.features
This adds a method to return the names of all policy-controlled features supported by the browser. Because this list is determined by the set of features implemented by Chrome, rather than conformance to any particular spec, the tests are in /webexposed/ rather than WPT. (Existing IDL tests in WPT cover the existence of the new method and the data types that it returns, without depending on the exact values returned.) Bug: 917070 Change-Id: I35ccbdce794e236500d15afe5419057a8f162ae7 Reviewed-on: https://chromium-review.googlesource.com/c/1387151 Commit-Queue: Ian Clelland <[email protected]> Reviewed-by: Rick Byers <[email protected]> Cr-Commit-Position: refs/heads/master@{#625667}
- Loading branch information
1 parent
95d10c7
commit f4c41ee
Showing
14 changed files
with
158 additions
and
0 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
accelerometer/Accelerometer-supported-by-feature-policy.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<title>Test that accelerometer is advertised in the feature list</title> | ||
<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features"> | ||
<link rel="help" href="https://w3c.github.io/sensors/#feature-policy-api"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(() => { | ||
assert_in_array('accelerometer', document.featurePolicy.features()); | ||
}, 'document.featurePolicy.features should advertise accelerometer.'); | ||
</script> |
11 changes: 11 additions & 0 deletions
11
ambient-light/AmbientLightSensor-supported-by-feature-policy.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<title>Test that ambient-light-sensor is advertised in the feature list</title> | ||
<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features"> | ||
<link rel="help" href="https://w3c.github.io/sensors/#feature-policy-api"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(() => { | ||
assert_in_array('ambient-light-sensor', document.featurePolicy.features()); | ||
}, 'document.featurePolicy.features should advertise ambient-light-sensor.'); | ||
</script> |
11 changes: 11 additions & 0 deletions
11
encrypted-media/encrypted-media-supported-by-feature-policy.tentative.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<title>Test that encrypted-media is advertised in the feature list</title> | ||
<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features"> | ||
<link rel="help" href="https://github.com/w3c/encrypted-media/pull/432"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(() => { | ||
assert_in_array('encrypted-media', document.featurePolicy.features()); | ||
}, 'document.featurePolicy.features should advertise encrypted-media.'); | ||
</script> |
11 changes: 11 additions & 0 deletions
11
feature-policy/payment-supported-by-feature-policy.tentative.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<title>Test that payment is advertised in the feature list</title> | ||
<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features"> | ||
<link rel="help" href="https://github.com/w3c/payment-request/issues/600"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(() => { | ||
assert_in_array('payment', document.featurePolicy.features()); | ||
}, 'document.featurePolicy.features should advertise payment.'); | ||
</script> |
11 changes: 11 additions & 0 deletions
11
feature-policy/picture-in-picture-supported-by-feature-policy.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<title>Test that picture-in-picture is advertised in the feature list</title> | ||
<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features"> | ||
<link rel="help" href="https://wicg.github.io/picture-in-picture/#feature-policy"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(() => { | ||
assert_in_array('picture-in-picture', document.featurePolicy.features()); | ||
}, 'document.featurePolicy.features should advertise picture-in-picture.'); | ||
</script> |
11 changes: 11 additions & 0 deletions
11
geolocation-sensor/GeolocationSensor-supported-by-feature-policy.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<title>Test that geolocation is advertised in the feature list</title> | ||
<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features"> | ||
<link rel="help" href="https://w3c.github.io/sensors/#feature-policy-api"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(() => { | ||
assert_in_array('geolocation', document.featurePolicy.features()); | ||
}, 'document.featurePolicy.features should advertise geolocation.'); | ||
</script> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<title>Test that gyroscope is advertised in the feature list</title> | ||
<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features"> | ||
<link rel="help" href="https://w3c.github.io/sensors/#feature-policy-api"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(() => { | ||
assert_in_array('gyroscope', document.featurePolicy.features()); | ||
}, 'document.featurePolicy.features should advertise gyroscope.'); | ||
</script> |
11 changes: 11 additions & 0 deletions
11
html/semantics/embedded-content/media-elements/autoplay-supported-by-feature-policy.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<title>Test that autoplay is advertised in the feature list</title> | ||
<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features"> | ||
<link rel="help" href="https://html.spec.whatwg.org/multipage/infrastructure.html#policy-controlled-features"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(() => { | ||
assert_in_array('autoplay', document.featurePolicy.features()); | ||
}, 'document.featurePolicy.features should advertise autoplay.'); | ||
</script> |
11 changes: 11 additions & 0 deletions
11
magnetometer/Magnetometer-supported-by-feature-policy.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<title>Test that magnetometer is advertised in the feature list</title> | ||
<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features"> | ||
<link rel="help" href="https://w3c.github.io/sensors/#feature-policy-api"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(() => { | ||
assert_in_array('magnetometer', document.featurePolicy.features()); | ||
}, 'document.featurePolicy.features should advertise magnetometer.'); | ||
</script> |
15 changes: 15 additions & 0 deletions
15
mediacapture-streams/MediaStream-supported-by-feature-policy.html
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<title>Test that accelerometer is advertised in the feature list</title> | ||
<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features"> | ||
<link rel="help" href="https://w3c.github.io/mediacapture-main/#feature-policy-integration"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(() => { | ||
assert_in_array('camera', document.featurePolicy.features()); | ||
}, 'document.featurePolicy.features should advertise camera.'); | ||
|
||
test(() => { | ||
assert_in_array('microphone', document.featurePolicy.features()); | ||
}, 'document.featurePolicy.features should advertise microphone.'); | ||
</script> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<title>Test that wake-lock is advertised in the feature list</title> | ||
<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features"> | ||
<link rel="help" href="https://w3c.github.io/wake-lock/#dfn-wake-lock-feature"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(() => { | ||
assert_in_array('wake-lock', document.featurePolicy.features()); | ||
}, 'document.featurePolicy.features should advertise wake-lock.'); | ||
</script> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<title>Test that usb is advertised in the feature list</title> | ||
<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features"> | ||
<link rel="help" href="https://wicg.github.io/webusb/#feature-policy"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(() => { | ||
assert_in_array('usb', document.featurePolicy.features()); | ||
}, 'document.featurePolicy.features should advertise usb.'); | ||
</script> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<title>Test that xr is advertised in the feature list</title> | ||
<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features"> | ||
<link rel="help" href="https://immersive-web.github.io/webxr/#feature-policy"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(() => { | ||
assert_in_array('xr', document.featurePolicy.features()); | ||
}, 'document.featurePolicy.features should advertise xr.'); | ||
</script> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<title>Test that sync-xhr is advertised in the feature list</title> | ||
<link rel="help" href="https://w3c.github.io/webappsec-feature-policy/#dom-featurepolicy-features"> | ||
<link rel="help" href="https://xhr.spec.whatwg.org/#feature-policy-integration"> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script> | ||
test(() => { | ||
assert_in_array('sync-xhr', document.featurePolicy.features()); | ||
}, 'document.featurePolicy.features should advertise sync-xhr.'); | ||
</script> |