Move iframe onload handler setup later to avoid initial about:blank onload event.
Move iframe onload handler setup later to avoid initial about:blank onload event.
--- 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>