blob: 9426dd9ab8e931aa0363592698dd97fb9b53a8c8 [file] [log] [blame]
<base href="done">
var navigate = true;
// TODO(gcasto): Not sure why this is necessary, but calling
// window.domAutomationController directly in setTimeout seemt to causes the
// function to be evaluated inline.
function delayedUpload() {
function state_changed(xhr) {
if (xhr.readyState == 4) {
if (navigate) { = "done.html";
} else {
// Pretend like auth succeeded by hiding the login and signup forms.
document.getElementById("testform").style.display = "none";
document.getElementById("signup_testform").style.display = "none";
// Delay upload so that handler in PasswordAutofillAgent can be run
// first. This will happen immediately after JS execution ends, so this
// shouldn't introduce any timing dependent flakes.
setTimeout(delayedUpload, 0);
function send_xhr() {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() { state_changed(xhr); };"GET", "password_xhr_submit.html", true);
<form onsubmit="send_xhr(); return false;" id="testform">
<input type="text" id="username_field" name="username_field">
<input type="password" id="password_field" name="password_field">
<input type="submit" id="submit_button" name="submit_button">
<form action="password_xhr_submit.html" onsubmit="send_xhr(); return false;"
<input type="text" id="signup_username_field" name="signup_username_field">
<input type="password" id="signup_password_field"
name="signup_password_field" autocomplete="new-password">
<input type="password" id="confirmation_password_field"
name="confirmation_password_field" autocomplete="new-password">
<input type="submit" id="signup_submit_button" name="signup_submit_button">