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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-whitelisted-at-blob-denied.html

Issue 1495013002: Check for equality of the URL's origin in replaceState/pushState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Put all logic in History.cpp, change tests to testharness Created 5 years 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/navigation/pushstate-whitelisted-at-blob-denied.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-whitelisted-at-blob-denied.html b/third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-whitelisted-at-blob-denied.html
new file mode 100644
index 0000000000000000000000000000000000000000..48960d8c3283514d44c4ee0ffd3ddda0e79bab24
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-whitelisted-at-blob-denied.html
@@ -0,0 +1,22 @@
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ testRunner.addOriginAccessWhitelistEntry(location.origin, location.protocol, '', false);
+}
+
+var blobUrl = URL.createObjectURL(new Blob([
+ "<script>" +
+ "try {" +
+ " history.pushState(null, null, " + JSON.stringify(document.URL) + ");" +
+ " document.write('FAIL: pushState from blob:-URL succeeded.');" +
+ "} catch(e) {" +
+ " document.write('PASS: pushState from blob:-URL was blocked.');" +
+ "}" +
+ "if (window.testRunner)" +
+ " testRunner.notifyDone();" +
+ "<\/script>"
+], {type:"text/html"}));
+
+location.href = blobUrl;
+</script>

Powered by Google App Engine
This is Rietveld 408576698