зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1523562 [wpt PR 15025] - [ Feature Policy ] Report for unoptimized-images, a=testonly
Automatic update from web-platform-tests [ Feature Policy ] Report for unoptimized-images This CL adds the logic for reporting potential and actual violations of the unoptimized-images policy. Bug: 915788 Change-Id: Ide886ef8d04af0f7a36f63b99be8269cf8d2014d Reviewed-on: https://chromium-review.googlesource.com/c/1421740 Commit-Queue: Ehsan Karamad <ekaramad@chromium.org> Reviewed-by: Steve Kobes <skobes@chromium.org> Cr-Commit-Position: refs/heads/master@{#625588} -- wpt-commits: fd09bdd65df429534a52c5aaf5107ad518b8dfc0 wpt-pr: 15025
This commit is contained in:
Родитель
fc3ce01f37
Коммит
c05558b765
Двоичные данные
testing/web-platform/tests/feature-policy/reporting/unoptimized-image.jpg
Normal file
Двоичные данные
testing/web-platform/tests/feature-policy/reporting/unoptimized-image.jpg
Normal file
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 43 KiB |
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src='/resources/testharness.js'></script>
|
||||
<script src='/resources/testharnessreport.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<img src="./unoptimized-image.jpg">
|
||||
<script>
|
||||
var check_report_format = (reports, observer) => {
|
||||
let report = reports[0];
|
||||
assert_equals(report.type, "feature-policy-violation");
|
||||
assert_equals(report.url, document.location.href);
|
||||
assert_equals(report.body.featureId, "unoptimized-images");
|
||||
assert_equals(report.body.disposition, "enforce");
|
||||
};
|
||||
|
||||
async_test(t => {
|
||||
new ReportingObserver(t.step_func_done(check_report_format),
|
||||
{types: ['feature-policy-violation'], buffered: true}).observe();
|
||||
}, "unoptimized-images Report Format");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1 @@
|
|||
Feature-Policy: unoptimized-images 'none'
|
Загрузка…
Ссылка в новой задаче