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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-allowed-by-container-policy-relocate.html

Issue 2855133004: Re-enable feature policy layout tests after bug fix. (Closed)
Patch Set: Rebased FlagExpectations/site-per-process Created 3 years, 8 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/fullscreen-allowed-by-container-policy-relocate.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-allowed-by-container-policy-relocate.html b/third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-allowed-by-container-policy-relocate.html
index 0fb8d85dba713e5c80a75a4fd205e859cef5ac67..17de45272dd66f319814fc46896ffb84e2fbf46c 100644
--- a/third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-allowed-by-container-policy-relocate.html
+++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-allowed-by-container-policy-relocate.html
@@ -1,31 +1,32 @@
<!DOCTYPE html>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
+<iframe src="about:blank" allow="fullscreen"></iframe>
+<iframe src="about:blank" allow="fullscreen" allowfullscreen></iframe>
+<iframe src="about:blank" allowfullscreen></iframe>
<script>
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.dumpAsText();
- }
-</script>
-<iframe id="f1" src="about:blank" allow="fullscreen"></iframe>
-<iframe id="f2" src="about:blank" allow="fullscreen" allowfullscreen></iframe>
-<iframe id="f3" src="about:blank" allowfullscreen></iframe>
-<iframe id="f4" src="about:blank" allow="fullscreen"></iframe>
-<iframe id="f5" src="about:blank" allow="fullscreen" allowfullscreen></iframe>
-<iframe id="f6" src="about:blank" allowfullscreen></iframe>
-<script>
-function loadFrame(id, src, is_feature_enabled) {
- var iframe = document.getElementById(id);
- promise_test(function(t) {
+var srcs = [
+ "http://localhost:8000/feature-policy/resources/feature-policy-fullscreen.html",
+ "resources/feature-policy-fullscreen-relocate.html"
+];
+
+function loadFrame(iframe, src) {
+ var allowfullscreen = iframe.allowFullscreen;
iclelland 2017/05/18 19:56:59 allowfullscreen => allowFullscreen
+ var allow = iframe.hasAttribute('allow');
+ // fullscreen is enabled if:
+ // a. relocating within the same origin; or
+ // b. relocating across origin, with allowfullscreen not overriden by
+ // container policy.
+ var enabled =
iclelland 2017/05/18 19:56:58 I think we should call this something like "expect
lunalu1 2017/05/19 20:54:08 Done
+ (src === srcs[0]) || (src === srcs[1] && iframe.allowFullscreen && !allow)
+ promise_test(function() {
iframe.src = src;
return new Promise(function(resolve, reject) {
window.addEventListener('message', function(e) {
- if (e.data.type === 'change' || e.data.type === 'error') {
resolve(e.data);
- }
- });
+ }, { once: true });
}).then(function(data) {
- if (is_feature_enabled) {
+ if (enabled) {
assert_true(data.enabled, 'Document.fullscreenEnabled:');
assert_equals(data.type, 'change', 'Document.requestFullscreen():');
} else {
@@ -33,12 +34,17 @@ function loadFrame(id, src, is_feature_enabled) {
assert_equals(data.type, 'error', 'Document.requestFullscreen():');
}
});
- }, 'iframe ' + id + ' relocated to URL: ' + src + ' with allowfullscreen = ' + iframe.allowFullscreen + ' is ' + (is_feature_enabled ? 'enabled' : 'disabled') + ' by container policy.');
+ }, 'iframe relocated to URL: ' + src + ' with allowpaymentrequest = ' +
+ allowfullscreen + ' allow = ' + (allow ? 'fullscreen' : 'undefined') +
+ ' is ' + (enabled ? 'enabled' : 'disabled') + ' by container policy.');
+}
+
+window.onload = function() {
+ var iframes = document.getElementsByTagName('iframe');
+ for (var src of srcs) {
+ for (var iframe of iframes) {
+ loadFrame(iframe, src);
+ }
+ }
}
-loadFrame("f1", "http://localhost:8000/feature-policy/resources/feature-policy-fullscreen.html", true);
-loadFrame("f2", "http://localhost:8000/feature-policy/resources/feature-policy-fullscreen.html", true);
-loadFrame("f3", "http://localhost:8000/feature-policy/resources/feature-policy-fullscreen.html", true);
-loadFrame("f4", "resources/feature-policy-fullscreen-relocate.html", false);
-loadFrame("f5", "resources/feature-policy-fullscreen-relocate.html", false);
-loadFrame("f6", "resources/feature-policy-fullscreen-relocate.html", true);
</script>

Powered by Google App Engine
This is Rietveld 408576698