Commit 20bd04b7 authored by Ian Clelland's avatar Ian Clelland Committed by Commit Bot

Use allow attribute for delegation in WebUSB WPT

With an upcoming change to Feature/Permissions Policy, the header
alone will no longer be sufficient to delegate permissions to use
powerful features in subframes. The iframe allow attribute must
be used in conjunction with it. The header can still be used to
block delegation.

This change updates the WebUSB WPTs to use the allow attribute for
delegation.

Bug: 1095641
Change-Id: I278d5f3b9a105b5ed0ac556223908dc83524ef7d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2424634
Commit-Queue: Ian Clelland <iclelland@chromium.org>
Auto-Submit: Ian Clelland <iclelland@chromium.org>
Reviewed-by: default avatarCharlie Hu <chenleihu@google.com>
Cr-Commit-Position: refs/heads/master@{#809826}
parent 8b5613b0
...@@ -27,15 +27,17 @@ async_test(t => { ...@@ -27,15 +27,17 @@ async_test(t => {
expect_feature_available_default); expect_feature_available_default);
}, header + ' allows workers in same-origin iframes.'); }, header + ' allows workers in same-origin iframes.');
// Set allow="usb" on iframe element to delegate 'usb' to cross origin subframe.
async_test(t => { async_test(t => {
test_feature_availability('usb.getDevices()', t, cross_origin_src, test_feature_availability('usb.getDevices()', t, cross_origin_src,
expect_feature_available_default); expect_feature_available_default, 'usb');
}, header + ' allows cross-origin iframes.'); }, header + ' allows cross-origin iframes.');
// Set allow="usb" on iframe element to delegate 'usb' to cross origin subframe.
async_test(t => { async_test(t => {
test_feature_availability('usb.getDevices()', t, test_feature_availability('usb.getDevices()', t,
cross_origin_worker_frame_src, cross_origin_worker_frame_src,
expect_feature_available_default); expect_feature_available_default, 'usb');
}, header + ' allows workers in cross-origin iframes.'); }, header + ' allows workers in cross-origin iframes.');
fetch_tests_from_worker(new Worker( fetch_tests_from_worker(new Worker(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment