8 // TODO(gcasto): Not sure why this is necessary, but calling
9 // window.domAutomationController directly in setTimeout seemt to causes the
10 // function to be evaluated inline.
11 function delayedUpload() {
12 window
.domAutomationController
.send("FETCH_FINISHED");
15 function send_fetch() {
20 window
.top
.location
.href
= "done.html";
22 // Pretend like auth succeeded by hiding the login and signup forms.
23 document
.getElementById("testform").style
.display
= "none";
24 document
.getElementById("signup_testform").style
.display
= "none";
25 window
.domAutomationController
.setAutomationId(0);
26 // Delay upload so that handler in PasswordAutofillAgent can be run
27 // first. This will happen immediately after JS execution ends, so
28 // this shouldn't introduce any timing dependent flakes.
29 setTimeout(delayedUpload
, 0);
38 <form onsubmit=
"send_fetch(); return false;" id=
"testform">
39 <input type=
"text" id=
"username_field" name=
"username_field">
40 <input type=
"password" id=
"password_field" name=
"password_field">
41 <input type=
"submit" id=
"submit_button" name=
"submit_button">
44 <form action=
"password_fetch_submit.html" onsubmit=
"send_fetch(); return false;"
46 <input type=
"text" id=
"signup_username_field" name=
"signup_username_field">
47 <input type=
"password" id=
"signup_password_field"
48 name=
"signup_password_field" autocomplete=
"new-password">
49 <input type=
"password" id=
"confirmation_password_field"
50 name=
"confirmation_password_field" autocomplete=
"new-password">
51 <input type=
"submit" id=
"signup_submit_button" name=
"signup_submit_button">