Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy-relocate-and-no-reload.html |
| diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy-relocate-and-no-reload.html b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy-relocate-and-no-reload.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..358629f7d2983158b2ea255074e72dce43bf5f7a |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy-relocate-and-no-reload.html |
| @@ -0,0 +1,27 @@ |
| +<!DOCTYPE html> |
| +<script src="../../resources/testharness.js"></script> |
| +<script src="../../resources/testharnessreport.js"></script> |
| +<iframe src="resources/feature-policy-vibrate-relocate.html" allow="vibrate"></iframe> |
| +<script> |
| +window.onload = function () { |
| + var iframe = document.querySelector('iframe'); |
| + window.addEventListener('message', function() { |
| + // The iframe uses eventSender to emulate a user navigatation, which |
| + // requires absolute coordinates. |
| + iframe.contentWindow.postMessage( |
| + {x: iframe.offsetLeft, y: iframe.offsetTop}, "*"); |
| + }, { once: true }); |
| + promise_test(function() { |
| + return new Promise(function(resolve, reject) { |
| + window.addEventListener('message', function(e) { |
| + if (e.data.type === 'result') { |
| + resolve(e.data); |
| + } |
| + }); |
| + }).then(function(data) { |
| + assert_false(data.enabled, 'navigator.vibrate():'); |
| + }); |
| + }, 'iframe relocated without reload, allow = vibrate, is disabled on ' + |
|
iclelland
2017/05/18 19:36:12
I think a clearer message here might be something
lunalu1
2017/05/19 20:54:08
Done
|
| + 'cross-origin by container policy.'); |
| +} |
| +</script> |