https://github.com/web-platform-tests/wpt
Raw File
Tip revision: ef54841c892a555e99d0304a8924c77d2f5e4d5a authored by Simon Pieters on 05 June 2018, 08:49:15 UTC
HTML: fix joint session history test to not time out
Tip revision: ef54841
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