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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/security/opened-document-security-origin-resets-on-navigation.html

Issue 1670173002: Don't set the origin twice when navigating for javascript: URLs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: steal dcheng's tests Created 4 years, 10 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/opened-document-security-origin-resets-on-navigation.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/security/opened-document-security-origin-resets-on-navigation.html b/third_party/WebKit/LayoutTests/http/tests/security/opened-document-security-origin-resets-on-navigation.html
new file mode 100644
index 0000000000000000000000000000000000000000..c03e0adbbea5c1719d887496b9691bacec4b378e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/security/opened-document-security-origin-resets-on-navigation.html
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="/js-test-resources/js-test.js"></script>
+<script>
+var jsTestIsAsync = true;
+function runTest() {
+ var frame = document.body.appendChild(document.createElement("iframe"));
+ frame.src = "http://localhost:8000/security/resources/opened-document-security-origin-resets-on-navigation-frame.html";
+ frame.onload = function () {
+ frame.onload = null;
+ var blob = new Blob(["<script>(" + function () {
+ frame = document.documentElement.appendChild(document.createElement("iframe"));
+ frame.contentWindow.setTimeout("parent.document.open()", 0);
+ setTimeout(function () {
+ location = "javascript:'<script>setTimeout(top.finishJSTest, 0); parent.eval(\"alert(location)\"); top.testFailed(\"context security origin was not updated!\");</scr" + "ipt>'" }, 0);
+ } + "())</sc" + "ript>"], {type: "text/html"});
+ frame.contentWindow[0].location = URL.createObjectURL(blob);
+ }
+}
+</script>
+</head>
+<body onload="runTest()">
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698