Bug 1540393 [wpt PR 16113] - Change unoptimized-images feature policy to unoptimized-lossy-images., a=testonly
authorPaul Meyer <paulmeyer@chromium.org>
Thu, 18 Apr 2019 11:56:58 +0000
changeset 529945 b7a6db8ce61ff3b1ef7916a9469d0104c6397965
parent 529944 47b4de1dccba793969614a6d3be91c6dd46ba5f2
child 529946 b679c2b5b93305b25618b6b63e8291a9ea142b95
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1540393, 16113, 1524869, 942659, 1531354, 644488
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1540393 [wpt PR 16113] - Change unoptimized-images feature policy to unoptimized-lossy-images., a=testonly Automatic update from web-platform-tests Change unoptimized-images feature policy to unoptimized-lossy-images. This makes it more clear that this policy applies only to lossy image types (for now, just JPEG). This patch also makes the implementation more generic in order to make the policy compatible with parsed policy values and to pave the way for implementing a lossless-enforcing version of the unoptimized-images policy as well. These changes have been pulled from a larger partially reviewed CL: https://chromium-review.googlesource.com/c/chromium/src/+/1524869 Bug: 942659 Change-Id: I0242ac900b1653b89d6d8dbd63616003dcaaba62 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1531354 Commit-Queue: Paul Meyer <paulmeyer@chromium.org> Reviewed-by: Paul Meyer <paulmeyer@chromium.org> Reviewed-by: Robert Flack <flackr@chromium.org> Reviewed-by: Philip Rogers <pdr@chromium.org> Reviewed-by: Ken Buchanan <kenrb@chromium.org> Reviewed-by: Ian Clelland <iclelland@chromium.org> Cr-Commit-Position: refs/heads/master@{#644488} -- wpt-commits: f19a0c4003dc469cd0972dab425acdcdd3a7d1d7 wpt-pr: 16113
testing/web-platform/tests/feature-policy/reporting/unoptimized-images-reporting-onload.html
testing/web-platform/tests/feature-policy/reporting/unoptimized-images-reporting-onload.html.headers
testing/web-platform/tests/feature-policy/reporting/unoptimized-images-reporting.html
testing/web-platform/tests/feature-policy/reporting/unoptimized-images-reporting.html.headers
testing/web-platform/tests/feature-policy/reporting/unoptimized-lossy-images-reporting-onload.html
testing/web-platform/tests/feature-policy/reporting/unoptimized-lossy-images-reporting-onload.html.headers
testing/web-platform/tests/feature-policy/reporting/unoptimized-lossy-images-reporting.html
testing/web-platform/tests/feature-policy/reporting/unoptimized-lossy-images-reporting.html.headers
deleted file mode 100644
--- a/testing/web-platform/tests/feature-policy/reporting/unoptimized-images-reporting-onload.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!DOCTYPE html>
-<html>
-  <head>
-    <script src='/resources/testharness.js'></script>
-    <script src='/resources/testharnessreport.js'></script>
-  </head>
-  <body>
-    <script>
-var image = new Image();
-image.src = "./unoptimized-image.jpg";
-
-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>
deleted file mode 100644
--- a/testing/web-platform/tests/feature-policy/reporting/unoptimized-images-reporting-onload.html.headers
+++ /dev/null
@@ -1,1 +0,0 @@
-Feature-Policy: unoptimized-images 'none'
deleted file mode 100644
--- a/testing/web-platform/tests/feature-policy/reporting/unoptimized-images-reporting.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!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>
deleted file mode 100644
--- a/testing/web-platform/tests/feature-policy/reporting/unoptimized-images-reporting.html.headers
+++ /dev/null
@@ -1,1 +0,0 @@
-Feature-Policy: unoptimized-images 'none'
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/feature-policy/reporting/unoptimized-lossy-images-reporting-onload.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <script src='/resources/testharness.js'></script>
+    <script src='/resources/testharnessreport.js'></script>
+  </head>
+  <body>
+    <script>
+var image = new Image();
+image.src = "./unoptimized-image.jpg";
+
+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-lossy-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>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/feature-policy/reporting/unoptimized-lossy-images-reporting-onload.html.headers
@@ -0,0 +1,1 @@
+Feature-Policy: unoptimized-lossy-images 'none'
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/feature-policy/reporting/unoptimized-lossy-images-reporting.html
@@ -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-lossy-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>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/feature-policy/reporting/unoptimized-lossy-images-reporting.html.headers
@@ -0,0 +1,1 @@
+Feature-Policy: unoptimized-lossy-images 'none'