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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/cascade/cross-origin-with-own-policy-window-open.html

Issue 2792213002: Prevent layout tests from being broken by data URL deprecation. (Closed)
Patch Set: Created 3 years, 9 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/security/contentSecurityPolicy/cascade/cross-origin-with-own-policy-window-open.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/cascade/cross-origin-with-own-policy-window-open.html b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/cascade/cross-origin-with-own-policy-window-open.html
index ce49fab009ad4435e531fd6f05ce27a25cd5a30b..f77bd32325e07db18a89f4ddd3db4cb2101beaa0 100644
--- a/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/cascade/cross-origin-with-own-policy-window-open.html
+++ b/third_party/WebKit/LayoutTests/http/tests/security/contentSecurityPolicy/cascade/cross-origin-with-own-policy-window-open.html
@@ -18,14 +18,16 @@
t.done();
}));
- window.open("data:text/html," +
- "<meta http-equiv='content-security-policy' content='img-src http://127.0.0.1:8000'>" +
- "<script>" +
- " var i = document.createElement('img');" +
- " i.onload = _ => opener.postMessage('loaded', '*');" +
- " i.onerror = _ => opener.postMessage('blocked', '*');" +
- " i.src = 'http://example.test:8000/resources/square.png?data-frame'" +
- "</scr" + "ipt>");
+ var win = window.open("about:blank");
+ win.document.write(
+ "<meta http-equiv='content-security-policy'" +
+ " content='img-src http://127.0.0.1:8000'>" +
+ "<script>" +
+ " var i = document.createElement('img');" +
+ " i.onload = _ => opener.postMessage('loaded', '*');" +
+ " i.onerror = _ => opener.postMessage('blocked', '*');" +
+ " i.src = 'http://example.test:8000/resources/square.png?data-frame'" +
+ "</scr" + "ipt>");
}, "Image loaded via data: frame blocked.");
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698