Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy.html

Issue 2855133004: Re-enable feature policy layout tests after bug fix. (Closed)
Patch Set: Updated fp-vibrate tests expect Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy.html b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy.html
index 13a7112406c7dcfd5b037744824a22ec8174d13d..20b64b46976299d67deb8c796875d44220fd54db 100644
--- a/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy.html
+++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy.html
@@ -1,26 +1,32 @@
<!DOCTYPE html>
-<html>
-<head>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
+<script src="resources/helper.js"></script>
+<iframe allow="vibrate"></iframe>
<script>
-if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.dumpChildFramesAsText();
-}
+var srcs = [
+ "resources/feature-policy-vibrate.html",
+ "http://localhost:8000/feature-policy-experimental-features/resources/feature-policy-vibrate.html"];
-function loaded() {
- var iframes = document.getElementsByTagName('iframe');
- for (var i = 0; i < iframes.length; ++i) { // < 1; ++i) { //
- var iframe = iframes[i];
- // The iframe uses eventSender to emulate a user navigatation, which requires absolute coordinates.
- iframe.contentWindow.postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "*");
+window.onload = function () {
+ var iframe = document.querySelector('iframe');
+ iframe.addEventListener('load', sendClick);
+ function loadFrame(src) {
+ 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():');
+ });
+ }, 'Navigator.vibrate enabled by container policy on URL: ' + src);
+ }
+ for (var src of srcs) {
+ loadFrame(src);
}
}
</script>
-</head>
-<body onload="loaded();">
-<iframe id="f1" src="resources/feature-policy-vibrate-enabled.html" allow="vibrate"></iframe>
-<iframe id="f2" src="http://localhost:8000/feature-policy/feature-policy-vibrate-enabled.html" allow="vibrate"></iframe>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698