From 1832abd9419a532881abe413ef20e717ee8d2a3e Mon Sep 17 00:00:00 2001 From: Ian Clelland Date: Thu, 22 Nov 2018 07:59:36 -0800 Subject: [PATCH] Fix Feature Policy report output This brings the feature policy report format in line with the spec, and fixes the tests which were broken by WPT import. Bug: 907232 Change-Id: If9d9469956221c18a1aa72ee39debb1340efc01f Reviewed-on: https://chromium-review.googlesource.com/c/1338167 Commit-Queue: Ian Clelland Reviewed-by: Kinuko Yasuda Cr-Commit-Position: refs/heads/master@{#610427} --- .../experimental-features/resources/common.js | 4 ++-- .../reporting/camera-report-only.https.html | 6 +++--- .../reporting/camera-reporting.https.html | 1 - .../reporting/document-write-report-only.html | 6 +++--- .../reporting/document-write-reporting.html | 1 - .../encrypted-media-report-only.https.html | 6 +++--- .../reporting/encrypted-media-reporting.https.html | 7 +++---- .../reporting/fullscreen-report-only.html | 6 +++--- feature-policy/reporting/fullscreen-reporting.html | 1 - .../reporting/generic-sensor-report-only.https.html | 13 ++++++------- .../reporting/generic-sensor-reporting.https.html | 13 ++++++------- .../reporting/geolocation-report-only.https.html | 6 +++--- .../reporting/geolocation-reporting.https.html | 2 -- .../reporting/microphone-report-only.https.html | 6 +++--- .../reporting/microphone-reporting.https.html | 1 - feature-policy/reporting/midi-report-only.html | 6 +++--- feature-policy/reporting/midi-reporting.html | 1 - .../reporting/payment-report-only.https.html | 6 +++--- .../reporting/payment-reporting.https.html | 1 - .../reporting/picture-in-picture-report-only.html | 6 +++--- .../reporting/picture-in-picture-reporting.html | 9 ++++----- feature-policy/reporting/sync-xhr-report-only.html | 6 +++--- feature-policy/reporting/sync-xhr-reporting.html | 1 - .../reporting/unsized-media-reporting.html | 2 +- feature-policy/reporting/usb-report-only.https.html | 6 +++--- feature-policy/reporting/usb-reporting.https.html | 1 - feature-policy/reporting/vr-report-only.https.html | 9 ++++----- feature-policy/reporting/vr-reporting.https.html | 1 - feature-policy/reporting/xr-report-only.https.html | 9 ++++----- feature-policy/reporting/xr-reporting.https.html | 1 - 30 files changed, 63 insertions(+), 81 deletions(-) diff --git a/feature-policy/experimental-features/resources/common.js b/feature-policy/experimental-features/resources/common.js index 42790b8a2e79cc..cbd0518ff21521 100644 --- a/feature-policy/experimental-features/resources/common.js +++ b/feature-policy/experimental-features/resources/common.js @@ -70,7 +70,7 @@ window.reporting_observer_instance = new ReportingObserver((reports, observer) = if (window.reporting_observer_callback) { reports.forEach(window.reporting_observer_callback); } -}, {types: ["feature-policy"]}); +}, {types: ["feature-policy-violation"]}); window.reporting_observer_instance.observe(); window.reporting_observer_callback = null; @@ -79,7 +79,7 @@ function wait_for_violation_in_file(feature, file_name) { return new Promise( (resolve) => { assert_equals(null, window.reporting_observer_callback); window.reporting_observer_callback = (report) => { - var feature_match = (feature === report.body.feature); + var feature_match = (feature === report.body.featureId); var file_name_match = !file_name || (report.body.sourceFile.indexOf(file_name) !== -1); diff --git a/feature-policy/reporting/camera-report-only.https.html b/feature-policy/reporting/camera-report-only.https.html index 26488687e6fc75..c22e1a51740d4b 100644 --- a/feature-policy/reporting/camera-report-only.https.html +++ b/feature-policy/reporting/camera-report-only.https.html @@ -10,15 +10,15 @@