forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a runtime enabled feature for potential permissions policy violation
Implements w3c/webappsec-permissions-policy#546 Bug: 40941424 Change-Id: I969a7ce326986b2a05f9417038f5d164ca6308dc Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5925839 Reviewed-by: Ian Clelland <iclelland@chromium.org> Reviewed-by: Mustafa Emre Acer <meacer@chromium.org> Auto-Submit: Jun Kokatsu <jkokatsu@google.com> Commit-Queue: Mustafa Emre Acer <meacer@chromium.org> Cr-Commit-Position: refs/heads/main@{#1403647}
- Loading branch information
1 parent
fed5fd6
commit 0da5f39
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
permissions-policy/reporting/camera-potential-report-only.https.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,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src='/resources/testharness.js'></script> | ||
<script src='/resources/testharnessreport.js'></script> | ||
</head> | ||
<body> | ||
<script> | ||
var t = async_test("Camera Potential Report Format"); | ||
|
||
var check_report_format = (reports, observer) => { | ||
let report = reports[0]; | ||
assert_equals(report.type, "potential-permissions-policy-violation"); | ||
assert_equals(report.url, document.location.href); | ||
assert_equals(report.body.featureId, "camera"); | ||
assert_equals(report.body.disposition, "report"); | ||
}; | ||
|
||
new ReportingObserver(t.step_func_done(check_report_format), | ||
{types: ['potential-permissions-policy-violation']}).observe(); | ||
|
||
const iframe = document.createElement('iframe'); | ||
iframe.allow = "camera"; | ||
iframe.src = "/"; | ||
document.body.appendChild(iframe); | ||
</script> | ||
</body> | ||
</html> |
1 change: 1 addition & 0 deletions
1
permissions-policy/reporting/camera-potential-report-only.https.html.headers
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 @@ | ||
Permissions-Policy-Report-Only: camera=() |
28 changes: 28 additions & 0 deletions
28
permissions-policy/reporting/camera-potential-reporting.https.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,28 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src='/resources/testharness.js'></script> | ||
<script src='/resources/testharnessreport.js'></script> | ||
</head> | ||
<body> | ||
<script> | ||
var t = async_test("Camera Potential Report Format"); | ||
|
||
var check_report_format = (reports, observer) => { | ||
let report = reports[0]; | ||
assert_equals(report.type, "potential-permissions-policy-violation"); | ||
assert_equals(report.url, document.location.href); | ||
assert_equals(report.body.featureId, "camera"); | ||
assert_equals(report.body.disposition, "enforce"); | ||
}; | ||
|
||
new ReportingObserver(t.step_func_done(check_report_format), | ||
{types: ['potential-permissions-policy-violation']}).observe(); | ||
|
||
const iframe = document.createElement('iframe'); | ||
iframe.allow = "camera"; | ||
iframe.src = "/"; | ||
document.body.appendChild(iframe); | ||
</script> | ||
</body> | ||
</html> |
1 change: 1 addition & 0 deletions
1
permissions-policy/reporting/camera-potential-reporting.https.html.headers
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 @@ | ||
Permissions-Policy: camera=() |