| OLD | NEW |
| 1 <html> | 1 <html> |
| 2 <head> | 2 <head> |
| 3 <base href="done"> | 3 <base href="done"> |
| 4 | 4 |
| 5 <script> | 5 <script> |
| 6 | 6 |
| 7 var navigate = true; | 7 var navigate = true; |
| 8 | 8 |
| 9 // TODO(gcasto): Not sure why this is necessary, but calling | 9 // TODO(gcasto): Not sure why this is necessary, but calling |
| 10 // window.domAutomationController directly in setTimeout seemt to causes the | 10 // window.domAutomationController directly in setTimeout seemt to causes the |
| 11 // function to be evaluated inline. | 11 // function to be evaluated inline. |
| 12 function delayedUpload() { | 12 function delayedUpload() { |
| 13 window.domAutomationController.send("XHR_FINISHED"); | 13 window.domAutomationController.send("XHR_FINISHED"); |
| 14 } | 14 } |
| 15 | 15 |
| 16 function state_changed(xhr) { | 16 function state_changed(xhr) { |
| 17 if (xhr.readyState == 4) { | 17 if (xhr.readyState == 4) { |
| 18 if (navigate) { | 18 if (navigate) { |
| 19 window.top.location.href = "done.html"; | 19 window.top.location.href = "done.html"; |
| 20 } else { | 20 } else { |
| 21 // Pretend like auth succeeded by hiding the login and signup forms. | 21 // Pretend like auth succeeded by hiding the login and signup forms. |
| 22 document.getElementById("testform").style.display = "none"; | 22 document.getElementById("testform").style.display = "none"; |
| 23 document.getElementById("signup_testform").style.display = "none"; | 23 document.getElementById("signup_testform").style.display = "none"; |
| 24 window.domAutomationController.setAutomationId(0); | |
| 25 // Delay upload so that handler in PasswordAutofillAgent can be run | 24 // Delay upload so that handler in PasswordAutofillAgent can be run |
| 26 // first. This will happen immediately after JS execution ends, so this | 25 // first. This will happen immediately after JS execution ends, so this |
| 27 // shouldn't introduce any timing dependent flakes. | 26 // shouldn't introduce any timing dependent flakes. |
| 28 setTimeout(delayedUpload, 0); | 27 setTimeout(delayedUpload, 0); |
| 29 } | 28 } |
| 30 } | 29 } |
| 31 } | 30 } |
| 32 | 31 |
| 33 function send_xhr() { | 32 function send_xhr() { |
| 34 var xhr = new XMLHttpRequest(); | 33 var xhr = new XMLHttpRequest(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 50 id="signup_testform"> | 49 id="signup_testform"> |
| 51 <input type="text" id="signup_username_field" name="signup_username_field"> | 50 <input type="text" id="signup_username_field" name="signup_username_field"> |
| 52 <input type="password" id="signup_password_field" | 51 <input type="password" id="signup_password_field" |
| 53 name="signup_password_field" autocomplete="new-password"> | 52 name="signup_password_field" autocomplete="new-password"> |
| 54 <input type="password" id="confirmation_password_field" | 53 <input type="password" id="confirmation_password_field" |
| 55 name="confirmation_password_field" autocomplete="new-password"> | 54 name="confirmation_password_field" autocomplete="new-password"> |
| 56 <input type="submit" id="signup_submit_button" name="signup_submit_button"> | 55 <input type="submit" id="signup_submit_button" name="signup_submit_button"> |
| 57 </form> | 56 </form> |
| 58 </body> | 57 </body> |
| 59 </html> | 58 </html> |
| OLD | NEW |