Update web-platform-tests to revision 8a2ceb5f18911302b7a5c1cd2791f4ab50ad4326

This commit is contained in:
Josh Matthews 2017-10-12 09:25:50 -04:00
parent 462c272380
commit 1f531f66ea
5377 changed files with 174916 additions and 84369 deletions

View file

@ -87,11 +87,11 @@ interface VRDisplay : EventTarget {
/**
* Begin presenting to the VRDisplay. Must be called in response to a user gesture.
* Repeat calls while already presenting will update the VRLayers being displayed.
* Repeat calls while already presenting will update the layers being displayed.
* If the number of values in the leftBounds/rightBounds arrays is not 0 or 4 for any of the passed layers the promise is rejected
* If the source of any of the layers is not present (null), the promise is rejected.
*/
Promise<void> requestPresent(sequence<VRLayer> layers);
Promise<void> requestPresent(sequence<VRLayerInit> layers);
/**
* Stops presenting to the VRDisplay.
@ -101,10 +101,10 @@ interface VRDisplay : EventTarget {
/**
* Get the layers currently being presented.
*/
sequence<VRLayer> getLayers();
sequence<VRLayerInit> getLayers();
/**
* The VRLayer provided to the VRDisplay will be captured and presented
* The layer provided to the VRDisplay will be captured and presented
* in the HMD. Calling this function has the same effect on the source
* canvas as any other operation that uses its source image, and canvases
* created without preserveDrawingBuffer set to true will be cleared.
@ -115,7 +115,7 @@ interface VRDisplay : EventTarget {
typedef (HTMLCanvasElement or
OffscreenCanvas) VRSource;
dictionary VRLayer {
dictionary VRLayerInit {
VRSource? source = null;
sequence<float> leftBounds = [];

View file

@ -0,0 +1,33 @@
<!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-webvr.html';
var cross_origin_src = 'https://{{domains[www]}}:{{ports[https][0]}}' +
same_origin_src;
var header = 'Feature-Policy header vr "none"';
promise_test(() => {
return navigator.getVRDisplays().then(() => {
assert_unreached('expected promise to reject');
}, error => {
});
}, header + ' disallows the top-level document.');
async_test(t => {
test_feature_availability(
'navigator.getVRDisplays()', t, same_origin_src,
expect_feature_unavailable_default);
}, header + ' disallows same-origin iframes.');
async_test(t => {
test_feature_availability(
'navigator.getVRDisplays()', t, cross_origin_src,
expect_feature_unavailable_default);
}, header + ' disallows cross-origin iframes.');
</script>
</body>

View file

@ -0,0 +1 @@
Feature-Policy: vr 'none'

View file

@ -0,0 +1,27 @@
<!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 relative_path = '/feature-policy/resources/feature-policy-webvr.html';
var base_src = '/feature-policy/resources/redirect-on-load.html#';
var same_origin_src = base_src + relative_path;
var cross_origin_src = base_src + 'https://{{domains[www]}}:{{ports[https][0]}}' +
relative_path;
var header = 'Feature-Policy allow="vr" attribute';
async_test(t => {
test_feature_availability(
'navigator.getVRDisplays()', t, same_origin_src,
expect_feature_available_default, 'vr');
}, header + ' allows same-origin relocation');
async_test(t => {
test_feature_availability(
'navigator.getVRDisplays()', t, cross_origin_src,
expect_feature_unavailable_default, 'vr');
}, header + ' disallows cross-origin relocation');
</script>
</body>

View file

@ -0,0 +1,25 @@
<!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-webvr.html';
var cross_origin_src = 'https://{{domains[www]}}:{{ports[https][0]}}' +
same_origin_src;
var header = 'Feature-Policy allow="vr" attribute';
async_test(t => {
test_feature_availability(
'navigator.getVRDisplays()', t, same_origin_src,
expect_feature_available_default, 'vr');
}, header + ' allows same-origin iframe');
async_test(t => {
test_feature_availability(
'navigator.getVRDisplays()', t, cross_origin_src,
expect_feature_available_default, 'vr');
}, header + ' allows cross-origin iframe');
</script>
</body>

View file

@ -0,0 +1,30 @@
<!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-webvr.html';
var cross_origin_src = 'https://{{domains[www]}}:{{ports[https][0]}}' +
same_origin_src;
var header = 'Feature-Policy header vr *';
promise_test(
() => navigator.getVRDisplays(),
header + ' allows the top-level document.');
async_test(t => {
test_feature_availability(
'navigator.getVRDisplays()', t, same_origin_src,
expect_feature_available_default);
}, header + ' allows same-origin iframes.');
async_test(t => {
test_feature_availability(
'navigator.getVRDisplays()', t, cross_origin_src,
expect_feature_available_default);
}, header + ' allows cross-origin iframes.');
</script>
</body>

View file

@ -0,0 +1 @@
Feature-Policy: vr *

View file

@ -0,0 +1,30 @@
<!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-webvr.html';
var cross_origin_src = 'https://{{domains[www]}}:{{ports[https][0]}}' +
same_origin_src;
var header = 'Feature-Policy header vr "self"';
promise_test(
() => navigator.getVRDisplays(),
header + ' allows the top-level document.');
async_test(t => {
test_feature_availability(
'navigator.getVRDisplays()', t, same_origin_src,
expect_feature_available_default);
}, header + ' allows same-origin iframes.');
async_test(t => {
test_feature_availability(
'navigator.getVRDisplays()', t, cross_origin_src,
expect_feature_unavailable_default);
}, header + ' disallows cross-origin iframes.');
</script>
</body>