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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/remember-bad-password.html

Issue 2808753003: Carve out an exception for embedded credentials in XHR. (Closed)
Patch Set: Rebaseline. Created 3 years, 8 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/xmlhttprequest/remember-bad-password.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/remember-bad-password.html b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/remember-bad-password.html
new file mode 100644
index 0000000000000000000000000000000000000000..f15da260475b530c94f3f5bfe8616674b7e6413a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/remember-bad-password.html
@@ -0,0 +1,68 @@
+<body>
+<p><a href="rdar://problem/7062824">rdar://problem/7062824</a> A wrong password entered for site or proxy auth remains in WebCore credential storage, and is sent with subsequent requests.</p>
+<p>This test counts the number of failed requests server side.</p>
+<div id = result>Testing... Please cancel all authentication dialogs.</div></br>
+<div>Sync</div>
+<button onclick="sendWithCredentials(false)">With credentials</button>
+<button onclick="sendWithoutCredentials(false)">Without credentials</button>
+<div>Async</div>
+<button onclick="sendWithCredentials(true)">With credentials</button>
+<button onclick="sendWithoutCredentials(true)">Without credentials</button>
+<br>
+<button onclick="status()">Status</button>
+<script>
+if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone()
+}
+
+function sendWithCredentials(next)
+{
+ var xhr = new XMLHttpRequest;
+ xhr.open("GET", "resources/remember-bad-password/count-failures.php", next ? true : false, "foo", "bar");
+ xhr.send("");
+ if (next) {
+ xhr.onload = next;
+ xhr.onerror = next;
+ }
+}
+
+function sendWithoutCredentials(next)
+{
+ var xhr = new XMLHttpRequest;
+ xhr.open("GET", "resources/remember-bad-password/count-failures.php", next ? true : false);
+ xhr.send("");
+
+ if (next) {
+ xhr.onload = next;
+ xhr.onerror = next;
+ }
+}
+
+function status()
+{
+ var xhr = new XMLHttpRequest;
+ xhr.open("GET", "resources/remember-bad-password/count-failures.php?command=status", false);
+ xhr.send("");
+ return xhr.responseText;
+}
+
+function reset()
+{
+ var xhr = new XMLHttpRequest;
+ xhr.open("GET", "resources/remember-bad-password/count-failures.php?command=reset", false);
+ xhr.send("");
+}
+
+reset();
+sendWithCredentials();
+sendWithoutCredentials();
+sendWithCredentials(function() {
+sendWithoutCredentials(function() {
+var s = status();
+document.getElementById("result").innerHTML = (s == 2 ? "PASS" : ("FAIL: " + s));
+if (window.testRunner)
+ testRunner.notifyDone();
+})});
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698