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

Unified Diff: LayoutTests/http/tests/security/location-href-clears-username-password.html

Issue 874393006: Clear username and password from location.href when basic HTTP (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add LayoutTests. Created 5 years, 11 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/location-href-clears-username-password-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/http/tests/security/location-href-clears-username-password.html
diff --git a/LayoutTests/http/tests/security/location-href-clears-username-password.html b/LayoutTests/http/tests/security/location-href-clears-username-password.html
new file mode 100644
index 0000000000000000000000000000000000000000..74f7decd88dabe26e7c47cf0c0cdc99c1b5ae3d7
--- /dev/null
+++ b/LayoutTests/http/tests/security/location-href-clears-username-password.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML>
+<html>
+<head>
+<script>
+window.onload = function()
+{
+ if (window.testRunner)
+ {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ var div = document.getElementById('div1');
+ var frame = document.createElement('iframe');
+ frame.setAttribute('src', 'http://_username:_password@'
+ + location.host + '/security/resources/blank.html');
+ document.body.appendChild(frame);
+
+ frame.onload = function() {
+ var href = frame.contentWindow.location.href;
+ if (href.indexOf('_username') === -1 &&
+ href.indexOf('_password') === -1) {
+ alert('PASS');
+ }
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }
+}
+</script>
+</head>
+<body>This test passes if it alerts the string "PASS".<br/></body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/http/tests/security/location-href-clears-username-password-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698