Bug 1487175 [wpt PR 12741] - Enable FP reporting for VR/XR policy violations., a=testonly
authorIan Clelland <iclelland@chromium.org>
Thu, 13 Sep 2018 02:57:17 +0000
changeset 492318 425fc8fbdc68a8ae80a8d665d81ce57eaad959e0
parent 492317 e31a61a5ec97daf5fa286314d421ba274a62fe8c
child 492319 1b9f643e37fb37b0780dd99cf39b48d38cceee39
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1487175, 12741, 867471, 1195438, 590451
milestone64.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 1487175 [wpt PR 12741] - Enable FP reporting for VR/XR policy violations., a=testonly Automatic update from web-platform-testsEnable FP reporting for VR/XR policy violations. This queues a report through the Reporting API whenever VR or XR device access are requested in a frame in which the 'vr' feature is not allowed according to feature policy. Bug: 867471 Cq-Include-Trybots: luci.chromium.try‚Äč:win_optional_gpu_tests_rel Change-Id: I5e0256c799f986e30b1f3746ef0fce1b6d9f93eb Reviewed-on: https://chromium-review.googlesource.com/1195438 Reviewed-by: Brandon Jones <bajones@chromium.org> Commit-Queue: Ian Clelland <iclelland@chromium.org> Cr-Commit-Position: refs/heads/master@{#590451} -- wpt-commits: bfd5a21a187c0600de78834b0a051c0c702ca096 wpt-pr: 12741
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/feature-policy/reporting/vr-reporting.https.html
testing/web-platform/tests/feature-policy/reporting/vr-reporting.https.html.headers
testing/web-platform/tests/feature-policy/reporting/xr-reporting.https.html
testing/web-platform/tests/feature-policy/reporting/xr-reporting.https.html.headers
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -279768,16 +279768,26 @@
      {}
     ]
    ],
    "feature-policy/reporting/usb-reporting.https.html.headers": [
     [
      {}
     ]
    ],
+   "feature-policy/reporting/vr-reporting.https.html.headers": [
+    [
+     {}
+    ]
+   ],
+   "feature-policy/reporting/xr-reporting.https.html.headers": [
+    [
+     {}
+    ]
+   ],
    "feature-policy/resources/autoplay.js": [
     [
      {}
     ]
    ],
    "feature-policy/resources/feature-policy-allowedfeatures.html": [
     [
      {}
@@ -354925,16 +354935,28 @@
     ]
    ],
    "feature-policy/reporting/usb-reporting.https.html": [
     [
      "/feature-policy/reporting/usb-reporting.https.html",
      {}
     ]
    ],
+   "feature-policy/reporting/vr-reporting.https.html": [
+    [
+     "/feature-policy/reporting/vr-reporting.https.html",
+     {}
+    ]
+   ],
+   "feature-policy/reporting/xr-reporting.https.html": [
+    [
+     "/feature-policy/reporting/xr-reporting.https.html",
+     {}
+    ]
+   ],
    "fetch/api/abort/cache.https.html": [
     [
      "/fetch/api/abort/cache.https.html",
      {}
     ]
    ],
    "fetch/api/abort/destroyed-context.html": [
     [
@@ -593988,16 +594010,32 @@
   "feature-policy/reporting/usb-reporting.https.html": [
    "f90c602e449bd00e1d773edbce01e4fab63341e2",
    "testharness"
   ],
   "feature-policy/reporting/usb-reporting.https.html.headers": [
    "4fd1e269362c43d282ca8e3c5c35a5d648f0666b",
    "support"
   ],
+  "feature-policy/reporting/vr-reporting.https.html": [
+   "12cae052a167b47d020dcb8ec7887e5578ce48c5",
+   "testharness"
+  ],
+  "feature-policy/reporting/vr-reporting.https.html.headers": [
+   "d021af75636de273c868412cd98dfff50576151d",
+   "support"
+  ],
+  "feature-policy/reporting/xr-reporting.https.html": [
+   "a7a122237bb0bdef6d35954697c5a80dbebb8b0f",
+   "testharness"
+  ],
+  "feature-policy/reporting/xr-reporting.https.html.headers": [
+   "d021af75636de273c868412cd98dfff50576151d",
+   "support"
+  ],
   "feature-policy/resources/autoplay.js": [
    "56780cf6dc05879731bff0bbb1486c51b0b4141b",
    "support"
   ],
   "feature-policy/resources/feature-policy-allowedfeatures.html": [
    "9cc8e1e33a32d2d6265580a261ce761b37ec4acb",
    "support"
   ],
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/feature-policy/reporting/vr-reporting.https.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <script src='/resources/testharness.js'></script>
+    <script src='/resources/testharnessreport.js'></script>
+  </head>
+  <body>
+    <script>
+var check_report_format = (reports, observer) => {
+  let report = reports[0];
+  assert_equals(report.type, "feature-policy");
+  assert_equals(report.url, document.location.href);
+  assert_equals(report.body.feature, "vr");
+  assert_equals(report.body.sourceFile, document.location.href);
+  assert_equals(typeof report.body.message, "string");
+  assert_equals(typeof report.body.lineNumber, "number");
+  assert_equals(typeof report.body.columnNumber, "number");
+};
+
+promise_test(async (t) => {
+  const report = new Promise(resolve => {
+    new ReportingObserver((reports, observer) => resolve([reports, observer]),
+                          {types: ['feature-policy']}).observe();
+  });
+  await promise_rejects(t, 'SecurityError', navigator.getVRDisplays(),
+                        "VR device access should not be allowed in this document.");
+  const [reports, observer] = await report;
+  check_report_format(reports, observer);
+}, "VR Report Format");
+    </script>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/feature-policy/reporting/vr-reporting.https.html.headers
@@ -0,0 +1,1 @@
+Feature-Policy: vr 'none'
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/feature-policy/reporting/xr-reporting.https.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<html>
+  <head>
+    <script src='/resources/testharness.js'></script>
+    <script src='/resources/testharnessreport.js'></script>
+  </head>
+  <body>
+    <script>
+var check_report_format = (reports, observer) => {
+  let report = reports[0];
+  assert_equals(report.type, "feature-policy");
+  assert_equals(report.url, document.location.href);
+  assert_equals(report.body.feature, "vr");
+  assert_equals(report.body.sourceFile, document.location.href);
+  assert_equals(typeof report.body.message, "string");
+  assert_equals(typeof report.body.lineNumber, "number");
+  assert_equals(typeof report.body.columnNumber, "number");
+};
+
+promise_test(async (t) => {
+  const report = new Promise(resolve => {
+    new ReportingObserver((reports, observer) => resolve([reports, observer]),
+                          {types: ['feature-policy']}).observe();
+  });
+  await promise_rejects(t, 'SecurityError', navigator.xr.requestDevice(),
+                        "XR device access should not be allowed in this document.");
+  const [reports, observer] = await report;
+  check_report_format(reports, observer);
+}, "XR Report Format");
+    </script>
+  </body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/feature-policy/reporting/xr-reporting.https.html.headers
@@ -0,0 +1,1 @@
+Feature-Policy: vr 'none'