Bug 1540405 [wpt PR 16115] - Change unoptimized-images feature policy to unoptimized-lossy-images., a=testonly
authorPaul Meyer <paulmeyer@chromium.org>
Thu, 18 Apr 2019 11:57:15 +0000
changeset 529949 7f83beabe41bb0b80e21aa0ae40d55b78efc3e83
parent 529948 179f3521ae439afa03d55aee53a58c2fae76e590
child 529950 1e8593688c105e0d1f69659354b753bf68e8746e
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
bugs1540405, 16115, 1531354, 942659, 1541579, 644832
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 1540405 [wpt PR 16115] - 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. This is a reland of this reverted CL: https://chromium-review.googlesource.com/c/chromium/src/+/1531354 Bug: 942659 Change-Id: I7928de8a7f3e66841ec3792a4152a3570a709ca3 TBR: iclelland@chromium.org,pdr@chromium.org,kenrb@chromium.org Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1541579 Commit-Queue: Paul Meyer <paulmeyer@chromium.org> Reviewed-by: Paul Meyer <paulmeyer@chromium.org> Cr-Commit-Position: refs/heads/master@{#644832} -- wpt-commits: 1d5e060c91fdb8bf66d9246fc1d19b53c89a33ba wpt-pr: 16115
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'