--- a/toolkit/components/passwordmgr/test/mochitest/test_prompt.html
+++ b/toolkit/components/passwordmgr/test/mochitest/test_prompt.html
@@ -316,16 +316,25 @@ function handleLoad() {
is(username, "mochiuser1", "Checking for echoed username");
is(password, "mochipass1", "Checking for echoed password");
state = {
msg : "A username and password are being requested by http://mochi.test:8888. The site says: \"mochitest2\"",
title : "Authentication Required",
textValue : "mochiuser2",
passValue : "mochipass2",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
};
startCallbackTimer();
// We've already authenticated to this host:port. For this next
// request, the existing auth should be sent, we'll get a 401 reply,
// and we should prompt for new auth.
@@ -350,16 +359,25 @@ function handleLoad() {
// Same realm we've already authenticated to, but with a different
// expected password (to trigger an auth prompt, and change-password
// popup notification).
state = {
msg : "A username and password are being requested by http://mochi.test:8888. The site says: \"mochitest\"",
title : "Authentication Required",
textValue : "mochiuser1",
passValue : "mochipass1",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
passField : "mochipass1-new",
};
startCallbackTimer();
iframe.src = "authenticate.sjs?user=mochiuser1&pass=mochipass1-new";
break;
@@ -387,16 +405,25 @@ function handleLoad() {
// Same as last test, but for a realm we haven't already authenticated
// to (but have an existing saved login for, so that we'll trigger
// a change-password popup notification.
state = {
msg : "A username and password are being requested by http://mochi.test:8888. The site says: \"mochitest3\"",
title : "Authentication Required",
textValue : "mochiuser3",
passValue : "mochipass3-old",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
passField : "mochipass3-new",
};
startCallbackTimer();
iframe.src = "authenticate.sjs?user=mochiuser3&pass=mochipass3-new&realm=mochitest3";
break;
@@ -406,16 +433,25 @@ function handleLoad() {
is(username, "mochiuser3", "Checking for echoed username");
is(password, "mochipass3-new", "Checking for echoed password");
state = {
msg : "A username and password are being requested by http://mochi.test:8888. The site says: \"mochitest3\"",
title : "Authentication Required",
textValue : "",
passValue : "",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
textField : "mochiuser3",
passField : "mochipass3-old",
};
// Housekeeping: change it back to the original login4. Actually,
// just delete it and we'll re-add it as the next test.
@@ -521,16 +557,25 @@ function doTests() {
// ===== test 1 =====
testNum = 1;
state = {
msg : "the message",
title : "the title",
textValue : "abc",
passValue : "",
+ iconClass : "question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : true,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
textField : "xyz",
};
startCallbackTimer();
isOk = prompter1.prompt(defaultTitle, defaultMsg, "http://example.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, "abc", result);
@@ -541,16 +586,25 @@ function doTests() {
// ===== test 2 =====
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "abc",
passValue : "",
+ iconClass : "question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : true,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "cancel",
};
startCallbackTimer();
isOk = prompter1.prompt(defaultTitle, defaultMsg, "http://example.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, "abc", result);
ok(didDialog, "handleDialog was invoked");
@@ -559,16 +613,25 @@ function doTests() {
// ===== test 10 =====
// Default password provided, existing logins are ignored.
testNum = 10;
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "inputpw",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : true,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "passField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
passField : "secret",
};
pword.value = "inputpw";
startCallbackTimer();
isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://example.com",
@@ -580,16 +643,25 @@ function doTests() {
// ===== test 11 =====
// Default password provided, existing logins are ignored.
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "inputpw",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : true,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "passField",
+ defButton : "button0",
};
action = {
buttonClick : "cancel",
};
pword.value = "inputpw";
startCallbackTimer();
isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://example.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
@@ -599,16 +671,25 @@ function doTests() {
// ===== test 12 =====
// No default password provided, realm does not match existing login.
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : true,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "passField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
passField : "secret",
};
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://nonexample.com",
@@ -630,16 +711,25 @@ function doTests() {
// No default password provided, none of the logins from this host are
// password-only so the user is prompted.
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : true,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "passField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
passField : "secret",
};
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://example2.com",
@@ -698,16 +788,25 @@ function doTests() {
// ===== test 30 =====
// We don't pre-fill or save for NS_GetAuthKey-generated realms, but we should still prompt
testNum = 30;
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : true,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "passField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
passField : "fill2pass",
};
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "example2.com:80 (somerealm)",
@@ -719,16 +818,25 @@ function doTests() {
// ===== test 31 =====
// We don't pre-fill or save for NS_GetAuthKey-generated realms, but we should still prompt
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : true,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "passField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
passField : "fill2pass",
};
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "example2.com:80 (somerealm)",
@@ -739,16 +847,25 @@ function doTests() {
// ===== test 100 =====
testNum = 100;
state = {
msg : "the message",
title : "the title",
textValue : "inuser",
passValue : "inpass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
textField : "outuser",
passField : "outpass",
};
uname.value = "inuser";
pword.value = "inpass";
@@ -762,16 +879,25 @@ function doTests() {
// ===== test 101 =====
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "inuser",
passValue : "inpass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "cancel",
};
uname.value = "inuser";
pword.value = "inpass";
startCallbackTimer();
isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://nonexample.com",
@@ -782,16 +908,25 @@ function doTests() {
// ===== test 102 =====
// test filling in existing password-only login
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "examplepass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : false,
+ checkMsg : "Use Password Manager to remember this password.",
+ checked : true,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
};
uname.value = null;
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://example.com",
@@ -805,16 +940,25 @@ function doTests() {
// test filling in existing login (undetermined from multiple selection)
testNum++;
// user2name/user2pass would also be valid to fill here.
state = {
msg : "the message",
title : "the title",
textValue : "user1name",
passValue : "user1pass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : false,
+ checkMsg : "Use Password Manager to remember this password.",
+ checked : true,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
};
uname.value = null;
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://example2.com",
@@ -827,16 +971,25 @@ function doTests() {
// ===== test 104 =====
// test filling in existing login (user1 from multiple selection)
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "user1name",
passValue : "user1pass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : false,
+ checkMsg : "Use Password Manager to remember this password.",
+ checked : true,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
};
uname.value = "user1name";
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://example2.com",
@@ -849,16 +1002,25 @@ function doTests() {
// ===== test 105 =====
// test filling in existing login (user2 from multiple selection)
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "user2name",
passValue : "user2pass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : false,
+ checkMsg : "Use Password Manager to remember this password.",
+ checked : true,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
};
uname.value = "user2name";
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://example2.com",
@@ -871,16 +1033,25 @@ function doTests() {
// ===== test 106 =====
// test changing password
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "user2name",
passValue : "user2pass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : false,
+ checkMsg : "Use Password Manager to remember this password.",
+ checked : true,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
passField : "NEWuser2pass",
};
uname.value = "user2name";
pword.value = null;
startCallbackTimer();
@@ -894,16 +1065,25 @@ function doTests() {
// ===== test 107 =====
// test changing password (back to original value)
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "user2name",
passValue : "NEWuser2pass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : false,
+ checkMsg : "Use Password Manager to remember this password.",
+ checked : true,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
passField : "user2pass",
};
uname.value = "user2name";
pword.value = null;
startCallbackTimer();
@@ -917,16 +1097,25 @@ function doTests() {
// ===== test 120 =====
// We don't pre-fill or save for NS_GetAuthKey-generated realms, but we should still prompt
testNum = 120;
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
textField : "fill2user",
passField : "fill2pass",
};
uname.value = null;
pword.value = null;
@@ -941,16 +1130,25 @@ function doTests() {
// ===== test 121 =====
// We don't pre-fill or save for NS_GetAuthKey-generated realms, but we should still prompt
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
textField : "fill2user",
passField : "fill2pass",
};
uname.value = null;
pword.value = null;
@@ -985,16 +1183,25 @@ function doTests() {
// ===== test 500 =====
testNum = 500;
state = {
msg : "A username and password are being requested by http://example.com. The site says: \"some realm\"",
title : "Authentication Required",
textValue : "inuser",
passValue : "inpass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
textField : "outuser",
passField : "outpass",
};
authinfo.username = "inuser";
authinfo.password = "inpass";
@@ -1010,16 +1217,25 @@ function doTests() {
// ===== test 501 =====
testNum++;
state = {
msg : "A username and password are being requested by http://example.com. The site says: \"some realm\"",
title : "Authentication Required",
textValue : "outuser",
passValue : "outpass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "cancel",
};
startCallbackTimer();
isOk = prompter2.promptAuth(channel1, level, authinfo);
ok(!isOk, "Checking dialog return value (cancel)");
@@ -1028,16 +1244,25 @@ function doTests() {
// ===== test 502 =====
// test filling in password-only login
testNum++;
state = {
msg : "A username and password are being requested by http://example.com. The site says: \"http://example.com\"",
title : "Authentication Required",
textValue : "",
passValue : "examplepass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
};
authinfo.username = "";
authinfo.password = "";
authinfo.realm = "http://example.com";
@@ -1053,16 +1278,25 @@ function doTests() {
// test filling in existing login (undetermined from multiple selection)
testNum++;
// user2name/user2pass would also be valid to fill here.
state = {
msg : "A username and password are being requested by http://example2.com. The site says: \"http://example2.com\"",
title : "Authentication Required",
textValue : "user1name",
passValue : "user1pass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
};
authinfo.username = "";
authinfo.password = "";
authinfo.realm = "http://example2.com";
@@ -1078,16 +1312,25 @@ function doTests() {
// test filling in existing login (undetermined --> user1)
testNum++;
// user2name/user2pass would also be valid to fill here.
state = {
msg : "A username and password are being requested by http://example2.com. The site says: \"http://example2.com\"",
title : "Authentication Required",
textValue : "user1name",
passValue : "user1pass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
// enter one of the known logins, test 504+505 exercise the two possible states.
action = {
buttonClick : "ok",
textField : "user1name",
passField : "user1pass",
};
authinfo.username = "";
@@ -1106,16 +1349,25 @@ function doTests() {
// test filling in existing login (undetermined --> user2)
testNum++;
// user2name/user2pass would also be valid to fill here.
state = {
msg : "A username and password are being requested by http://example2.com. The site says: \"http://example2.com\"",
title : "Authentication Required",
textValue : "user1name",
passValue : "user1pass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
// enter one of the known logins, test 504+505 exercise the two possible states.
action = {
buttonClick : "ok",
textField : "user2name",
passField : "user2pass",
};
authinfo.username = "";
@@ -1135,16 +1387,25 @@ function doTests() {
// test changing a password (undetermined --> user2 w/ newpass)
testNum++;
// user2name/user2pass would also be valid to fill here.
state = {
msg : "A username and password are being requested by http://example2.com. The site says: \"http://example2.com\"",
title : "Authentication Required",
textValue : "user1name",
passValue : "user1pass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
// force to user2, and change the password
action = {
buttonClick : "ok",
textField : "user2name",
passField : "NEWuser2pass",
};
authinfo.username = "";
@@ -1164,16 +1425,25 @@ function doTests() {
// test changing a password (undetermined --> user2 w/ origpass)
testNum++;
// user2name/user2pass would also be valid to fill here.
state = {
msg : "A username and password are being requested by http://example2.com. The site says: \"http://example2.com\"",
title : "Authentication Required",
textValue : "user1name",
passValue : "user1pass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
// force to user2, and change the password back
action = {
buttonClick : "ok",
textField : "user2name",
passField : "user2pass",
};
authinfo.username = "";
@@ -1192,16 +1462,25 @@ function doTests() {
// ===== test 508 =====
// test proxy login (default = no autologin), make sure it prompts.
testNum++;
state = {
msg : "The proxy moz-proxy://127.0.0.1:8888 is requesting a username and password. The site says: \"Proxy Realm\"",
title : "Authentication Required",
textValue : "proxuser",
passValue : "proxpass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
};
proxyAuthinfo.username = "";
proxyAuthinfo.password = "";
proxyAuthinfo.realm = "Proxy Realm";
proxyAuthinfo.flags = Ci.nsIAuthInformation.AUTH_PROXY;
@@ -1242,16 +1521,25 @@ function doTests() {
// ===== test 510 =====
// test proxy login (with autologin), ensure it prompts after a failed auth.
testNum++;
state = {
msg : "The proxy moz-proxy://127.0.0.1:8888 is requesting a username and password. The site says: \"Proxy Realm\"",
title : "Authentication Required",
textValue : "proxuser",
passValue : "proxpass",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
};
proxyAuthinfo.username = "";
proxyAuthinfo.password = "";
proxyAuthinfo.realm = "Proxy Realm";
@@ -1303,16 +1591,25 @@ function doTests() {
// ===== test 1000 =====
testNum = 1000;
state = {
msg : "A username and password are being requested by http://mochi.test:8888. The site says: \"mochitest\"",
title : "Authentication Required",
textValue : "mochiuser1",
passValue : "mochipass1",
+ iconClass : "authentication-icon question-icon",
+ titleHidden : true,
+ textHidden : false,
+ passHidden : false,
+ checkHidden : true,
+ checkMsg : "",
+ checked : false,
+ focused : "textField",
+ defButton : "button0",
};
action = {
buttonClick : "ok",
};
startCallbackTimer();
iframe.src = "authenticate.sjs?user=mochiuser1&pass=mochipass1";
// ...remaining tests are driven by handleLoad()...