Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.   function waitForLoad() {
  3.     return new Promise(resolve => {
  4.       function handleLoad() {
  5.         window.removeEventListener("load", handleLoad);
  6.         resolve();
  7.       }
  8.       window.addEventListener("load", handleLoad);      
  9.     });
  10.   }
  11.  
  12.   add_task(async function test_no_prompt_on_navigation() {
  13.     // If login field values were set by the website, we don't
  14.     // prompt to save the login values if the user
  15.     // has not interacted with the fields before submiting.
  16.     await promiseFormsProcessed();
  17.  
  18.     let promptShown = false;
  19.     let promptShownPromise = promisePromptShown("passwordmgr-prompt-save").then(value => {
  20.       promptShown = true;
  21.     });
  22.  
  23.     let loadPromise = waitForLoad();
  24.     document.getElementById("link").click();
  25.     await loadPromise;
  26.     ok(!promptShown, "Prompt is not shown on navigation since the login fields were not modified");
  27.   });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement