blob: b72e2c6b52f3bc3f79bd811bcf34203e29c3f972 [file] [log] [blame]
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.dumpChildFramesAsText();
testRunner.setHandlesAuthenticationChallenges(true);
testRunner.setAuthenticationUsername("webkit");
testRunner.setAuthenticationPassword("rocks");
testRunner.setPrivateBrowsingEnabled_DEPRECATED(true);
testRunner.waitUntilDone();
}
function firstFrameLoaded() {
if (window.testRunner) {
testRunner.setHandlesAuthenticationChallenges(false);
testRunner.setPrivateBrowsingEnabled_DEPRECATED(false);
}
// If the username and password were in the WebCore CredentialStorage, WebKit would automatically send them out for this resource.
// The credentials would be wrong, but it would send them out.
// Since the credentails that were cached from the first iframe load should have been forgotten after private browsing was disabled,
// no credentials should be sent out automatically this time.
var frame = document.createElement("iframe");
frame.setAttribute("src", "resources/auth-echo.php");
frame.setAttribute("onload", "secondFrameLoaded()");
document.body.appendChild(frame);
}
function secondFrameLoaded() {
if (window.testRunner)
testRunner.notifyDone();
}
</script>
<body>
This test makes sure that auth credentials cached during a private browsing session do not leak out after private browsing is disabled.
<iframe src="resources/basic-auth.php?username=webkit&password=rocks" onload="firstFrameLoaded();"></iframe>
</body>