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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-auth-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-auth-denied.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-auth-denied.html b/third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-auth-denied.html
new file mode 100644
index 0000000000000000000000000000000000000000..13cf0f33407d22a289689a04d9dec210b91643bf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/navigation/pushstate-auth-denied.html
@@ -0,0 +1,15 @@
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+test(function () {
+ // http://username@password:localhost:8000/... should be blocked.
+ var originWithAuth = new URL(document.URL);
+ originWithAuth.username += 'username';
+ originWithAuth.password += 'password';
+ originWithAuth = originWithAuth.href;
+
+ assert_throws('SecurityError', function () {
+ history.pushState(null, null, originWithAuth);
+ });
+}, 'pushState that changes credentials should fail with SecurityError');
+</script>

Powered by Google App Engine
This is Rietveld 408576698