Bug 1490374 [wpt PR 12948] - Origin Policy: Add support for Feature Policy., a=testonly
authorDaniel Vogelheim <vogelheim@chromium.org>
Thu, 22 Nov 2018 10:34:02 +0000
changeset 504339 8446b6af9d52efb57bbf3965897970353a3a9a70
parent 504338 aca5ae992b39290a8795af5a6c92a12fa544e177
child 504340 4ed4a397f224d2987f7b8c7ba22fbdc63de465d9
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1490374, 12948, 751996, 1202202, 609331
milestone65.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 1490374 [wpt PR 12948] - Origin Policy: Add support for Feature Policy., a=testonly Automatic update from web-platform-testsOrigin Policy: Add support for Feature Policy. Bug: 751996 Change-Id: I969cd67059c6105f468dc56efe01c8de8869565b Reviewed-on: https://chromium-review.googlesource.com/c/1202202 Commit-Queue: Daniel Vogelheim <vogelheim@chromium.org> Reviewed-by: Mike West <mkwst@chromium.org> Cr-Commit-Position: refs/heads/master@{#609331} -- wpt-commits: f5eb262c515892953d66673563814f9b65f2402a wpt-pr: 12948
testing/web-platform/tests/.well-known/origin-policy/policy-features
testing/web-platform/tests/origin-policy/origin-policy-features.https.tentative.html
testing/web-platform/tests/origin-policy/origin-policy-features.https.tentative.html.headers
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/.well-known/origin-policy/policy-features
@@ -0,0 +1,6 @@
+{
+  "feature-policy": [
+    "camera 'self' https://example.org",
+    "geolocation https://example.org/"
+  ]
+}
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/origin-policy/origin-policy-features.https.tentative.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+  <script src='/resources/testharness.js'></script>
+  <script src='/resources/testharnessreport.js'></script>
+</head>
+<body>
+  <script>
+    async_test(t => {
+      assert_false(document.policy.allowsFeature('geolocation'));
+      assert_true(document.policy.allowsFeature('camera'));
+      t.done();
+    }, "Origin-Policy-based Feature policy");
+  </script>
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/origin-policy/origin-policy-features.https.tentative.html.headers
@@ -0,0 +1,1 @@
+Sec-Origin-Policy: policy-features