https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 03b7db51f21ce2a157454020bb46301b825152a5 authored by Alex Moshchuk on 13 April 2018, 23:12:06 UTC
Reland 2: Use PostTask to schedule cross-process postMessage forwarding.
Tip revision: 03b7db5
usb-allowed-by-feature-policy-attribute.https.sub.html
<!DOCTYPE html>
<body>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=/feature-policy/resources/featurepolicy.js></script>
<script>
'use strict';
var same_origin_src = '/feature-policy/resources/feature-policy-usb.html';
var cross_origin_src = 'https://{{domains[www]}}:{{ports[https][0]}}' +
  same_origin_src;
var feature_name = 'Feature policy "usb"';
var header = 'allow="usb" attribute';

async_test(t => {
  test_feature_availability(
      'usb.getDevices()', t, same_origin_src,
      expect_feature_available_default, 'usb');
}, feature_name + ' can be enabled in same-origin iframe using ' + header);

async_test(t => {
  test_feature_availability(
      'usb.getDevices()', t, cross_origin_src,
      expect_feature_available_default, 'usb');
}, feature_name + ' can be enabled in cross-origin iframe using ' + header);
</script>
</body>
back to top