Move iframe onload handler setup later to avoid initial about:blank onload event.
authordolske@mozilla.com
Sun, 16 Mar 2008 22:42:24 -0700
changeset 13161 dbb18fbf684967ece4ae0c94298c3ec908cbd5e9
parent 13160 7ad62f69bb0fa5b02249de44b50a69f161abdd44
child 13162 46ab89ae6d88736738f9a2bf7464ef77b372b23b
push idunknown
push userunknown
push dateunknown
milestone1.9b5pre
Move iframe onload handler setup later to avoid initial about:blank onload event.
toolkit/components/passwordmgr/test/test_prompt.html
--- a/toolkit/components/passwordmgr/test/test_prompt.html
+++ b/toolkit/components/passwordmgr/test/test_prompt.html
@@ -389,19 +389,16 @@ var authinfo = {
     domain   : "",
 
     flags : Ci.nsIAuthInformation.AUTH_HOST,
     authenticationScheme : "basic",
     realm : ""
 };
 
 
-var iframe = document.getElementById("iframe");
-iframe.onload = handleLoad;
-
 var prompter1 = promptFac.getPrompt(window, Ci.nsIAuthPrompt);
 var prompter2 = promptFac.getPrompt(window, Ci.nsIAuthPrompt2);
 
 function dialogTitle() { return "nsILoginManagerPrompter test #" + testNum; }
 var dialogText  = "This dialog should be modified and dismissed by the test.";
 var uname  = { value : null };
 var pword  = { value : null };
 var result = { value : null };
@@ -704,16 +701,20 @@ is(authinfo.username, "user2name", "Chec
 is(authinfo.password, "user2pass", "Checking returned password");
 
 
 // XXX check for and kill notification bar??
 // XXX check for checkbox / checkstate on old prompts?
 // XXX check NTLM domain stuff
 
 
+var iframe = document.getElementById("iframe");
+iframe.onload = handleLoad;
+
+
 // ===== test 1000 =====
 testNum = 1000;
 startCallbackTimer();
 iframe.src = "authenticate.sjs?user=mochiuser1&pass=mochipass1";
 
 // ...remaining tests are drived by handleLoad()...
 SimpleTest.waitForExplicitFinish();
 </script>