Index: third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy-relocate-and-reload.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy-relocate-and-reload.html b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy-relocate-and-reload.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b162aabf27671a5e1124076c677308e7657e8332 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy-relocate-and-reload.html |
@@ -0,0 +1,30 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<iframe src="about:blank" allow="vibrate"></iframe> |
+<script> |
+function sendClick() { |
+ // The iframe uses eventSender to emulate a user navigatation, which requires |
+ // absolute coordinates. |
+ this.contentWindow.postMessage({x: this.offsetLeft, y: this.offsetTop}, "*"); |
+} |
+ |
+window.onload = function () { |
+ var iframe = document.querySelector('iframe'); |
+ var src = "http://localhost:8000/feature-policy-experimental-features/resources/feature-policy-vibrate.html"; |
+ iframe.addEventListener('load', sendClick); |
+ promise_test(function() { |
+ iframe.src = src; |
+ return new Promise(function(resolve, reject) { |
+ window.addEventListener('message', function(e) { |
+ if (e.data.type === 'result') { |
+ resolve(e.data); |
+ } |
+ }); |
+ }).then(function(data) { |
+ assert_true(data.enabled, 'navigator.vibrate():'); |
+ }); |
+ }, 'iframe reloaded to URL: ' + src + ', allow = vibrate, is enabled on ' + |
iclelland
2017/05/18 19:36:12
And here, maybe instead of "reloaded to URL", we c
lunalu1
2017/05/19 20:54:08
Done.
|
+ 'cross-origin by container policy.'); |
+} |
+</script> |