blob: 2c2f8c489f468842afac227c3da26a314556c30e [file] [log] [blame]
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 send_fetch() {
function(response) {
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);
<form onsubmit="send_fetch(); 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_fetch_submit.html" onsubmit="send_fetch(); 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">