--- a/toolkit/components/passwordmgr/test/mochitest/test_prompt.html
+++ b/toolkit/components/passwordmgr/test/mochitest/test_prompt.html
@@ -269,221 +269,16 @@ function handleDialog(doc, testNum) {
dumpNotifications();
var dialog = doc.getElementById("commonDialog");
var ui = doc.defaultView.Dialog.ui;
var actualState = getPromptState(ui);
checkPromptState(actualState, state);
- switch(testNum) {
- case 1:
- action = {
- buttonClick : "ok",
- textField : "xyz",
- };
- // Temporarily commented out because of Bug #718543
- // is(doc.activeElement, userfield.inputField, "focus correct for test" + testNum);
- // doc.commandDispatcher.rewindFocus();
- // is(doc.activeElement, body, "description focusable");
- break;
- case 2:
- action = {
- buttonClick : "cancel",
- };
- break;
- case 10:
- action = {
- buttonClick : "ok",
- passField : "secret",
- };
- // Temporarily commented out because of Bug #718543
- // is(doc.activeElement, passfield.inputField, "focus correct for test" + testNum);
- break;
- case 11:
- action = {
- buttonClick : "cancel",
- };
- break;
- case 12:
- action = {
- buttonClick : "ok",
- passField : "secret",
- };
- break;
- case 14:
- action = {
- buttonClick : "ok",
- passField : "secret",
- };
- break;
- case 30:
- case 31:
- action = {
- buttonClick : "ok",
- passField : "fill2pass",
- };
- break;
- case 100:
- action = {
- buttonClick : "ok",
- textField : "outuser",
- passField : "outpass",
- };
- break;
- case 101:
- action = {
- buttonClick : "cancel",
- };
- break;
- case 102:
- action = {
- buttonClick : "ok",
- };
- break;
- case 103:
- action = {
- buttonClick : "ok",
- };
- break;
- case 104:
- action = {
- buttonClick : "ok",
- };
- break;
- case 105:
- action = {
- buttonClick : "ok",
- };
- break;
- case 106:
- action = {
- buttonClick : "ok",
- passField : "NEWuser2pass",
- };
- break;
- case 107:
- action = {
- buttonClick : "ok",
- passField : "user2pass",
- };
- break;
- case 120:
- case 121:
- action = {
- buttonClick : "ok",
- textField : "fill2user",
- passField : "fill2pass",
- };
- break;
- case 500:
- action = {
- buttonClick : "ok",
- textField : "outuser",
- passField : "outpass",
- };
- break;
- case 501:
- action = {
- buttonClick : "cancel",
- };
- break;
- case 502:
- action = {
- buttonClick : "ok",
- };
- break;
- case 503:
- action = {
- buttonClick : "ok",
- };
- break;
- case 504:
- // enter one of the known logins, test 504+505 exercise the two possible states.
- action = {
- buttonClick : "ok",
- textField : "user1name",
- passField : "user1pass",
- };
- break;
- case 505:
- // enter one of the known logins, test 504+505 exercise the two possible states.
- action = {
- buttonClick : "ok",
- textField : "user2name",
- passField : "user2pass",
- };
- break;
- case 506:
- // force to user2, and change the password
- action = {
- buttonClick : "ok",
- textField : "user2name",
- passField : "NEWuser2pass",
- };
- break;
- case 507:
- // force to user2, and change the password back
- action = {
- buttonClick : "ok",
- textField : "user2name",
- passField : "user2pass",
- };
- break;
- case 508:
- action = {
- buttonClick : "ok",
- };
- break;
- // No case 509, it's unprompted.
- case 510:
- action = {
- buttonClick : "ok",
- };
- break;
- case 511:
- action = {
- buttonClick : "ok",
- };
- break;
- case 1000:
- action = {
- buttonClick : "ok",
- };
- break;
- case 1001:
- action = {
- buttonClick : "ok",
- };
- break;
- // (1002 doesn't trigger a dialog)
- case 1003:
- action = {
- buttonClick : "ok",
- passField : "mochipass1-new",
- };
- break;
- case 1004:
- action = {
- buttonClick : "ok",
- passField : "mochipass3-new",
- };
- break;
- case 1005:
- action = {
- buttonClick : "ok",
- textField : "mochiuser3",
- passField : "mochipass3-old",
- };
- break;
- default:
- ok(false, "Uhh, unhandled switch for testNum #" + testNum);
- break;
- }
-
if ("textField" in action) {
doc.getElementById("loginTextbox").setAttribute("value", action.textField);
}
if ("passField" in action) {
doc.getElementById("password1Textbox").setAttribute("value", action.passField);
}
if (action.buttonClick == "ok")
@@ -522,16 +317,19 @@ function handleLoad() {
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",
};
+ 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.
iframe.src = "authenticate.sjs?user=mochiuser2&pass=mochipass2&realm=mochitest2";
break;
case 1001:
testNum++;
@@ -553,16 +351,20 @@ function handleLoad() {
// 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",
};
+ action = {
+ buttonClick : "ok",
+ passField : "mochipass1-new",
+ };
startCallbackTimer();
iframe.src = "authenticate.sjs?user=mochiuser1&pass=mochipass1-new";
break;
case 1003:
testNum++;
is(authok, "PASS", "Checking for successful authentication");
is(username, "mochiuser1", "Checking for echoed username");
is(password, "mochipass1-new", "Checking for echoed password");
@@ -586,31 +388,40 @@ function handleLoad() {
// 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",
};
+ action = {
+ buttonClick : "ok",
+ passField : "mochipass3-new",
+ };
startCallbackTimer();
iframe.src = "authenticate.sjs?user=mochiuser3&pass=mochipass3-new&realm=mochitest3";
break;
case 1004:
testNum++;
is(authok, "PASS", "Checking for successful authentication");
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 : "",
};
+ 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.
function clearIt() {
ok(true, "1004's clearIt() called.");
try {
tmpLogin.init("http://mochi.test:8888", null, "mochitest3",
"mochiuser3", "mochipass3-new", "", "");
pwmgr.removeLogin(tmpLogin);
@@ -711,47 +522,58 @@ function doTests() {
// ===== test 1 =====
testNum = 1;
state = {
msg : "the message",
title : "the title",
textValue : "abc",
passValue : "",
};
+ action = {
+ buttonClick : "ok",
+ textField : "xyz",
+ };
startCallbackTimer();
isOk = prompter1.prompt(defaultTitle, defaultMsg, "http://example.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, "abc", result);
ok(isOk, "Checking dialog return value (accept)");
ok(didDialog, "handleDialog was invoked");
is(result.value, "xyz", "Checking prompt() returned value");
// ===== test 2 =====
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "abc",
passValue : "",
};
+ action = {
+ buttonClick : "cancel",
+ };
startCallbackTimer();
isOk = prompter1.prompt(defaultTitle, defaultMsg, "http://example.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, "abc", result);
ok(didDialog, "handleDialog was invoked");
ok(!isOk, "Checking dialog return value (cancel)");
// ===== test 10 =====
// Default password provided, existing logins are ignored.
testNum = 10;
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "inputpw",
};
+ action = {
+ buttonClick : "ok",
+ passField : "secret",
+ };
pword.value = "inputpw";
startCallbackTimer();
isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://example.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
ok(isOk, "Checking dialog return value (accept)");
ok(didDialog, "handleDialog was invoked");
is(pword.value, "secret", "Checking returned password");
@@ -759,32 +581,39 @@ function doTests() {
// Default password provided, existing logins are ignored.
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "inputpw",
};
+ action = {
+ buttonClick : "cancel",
+ };
pword.value = "inputpw";
startCallbackTimer();
isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://example.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
ok(!isOk, "Checking dialog return value (cancel)");
ok(didDialog, "handleDialog was invoked");
// ===== test 12 =====
// No default password provided, realm does not match existing login.
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "",
};
+ action = {
+ buttonClick : "ok",
+ passField : "secret",
+ };
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://nonexample.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
ok(isOk, "Checking dialog return value (accept)");
ok(didDialog, "handleDialog was invoked");
is(pword.value, "secret", "Checking returned password");
@@ -802,16 +631,20 @@ function doTests() {
// password-only so the user is prompted.
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "",
};
+ action = {
+ buttonClick : "ok",
+ passField : "secret",
+ };
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://example2.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
ok(isOk, "Checking dialog return value (accept)");
ok(didDialog, "handleDialog was invoked");
is(pword.value, "secret", "Checking returned password");
@@ -866,16 +699,20 @@ function doTests() {
// 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 : "",
};
+ action = {
+ buttonClick : "ok",
+ passField : "fill2pass",
+ };
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "example2.com:80 (somerealm)",
Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
ok(isOk, "Checking dialog return value (accept)");
ok(didDialog, "handleDialog was invoked");
is(pword.value, "fill2pass", "Checking returned password");
@@ -883,32 +720,41 @@ function doTests() {
// 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 : "",
};
+ action = {
+ buttonClick : "ok",
+ passField : "fill2pass",
+ };
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "example2.com:80 (somerealm)",
Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, pword);
ok(isOk, "Checking dialog return value (accept)");
ok(didDialog, "handleDialog was invoked");
is(pword.value, "fill2pass", "Checking returned password");
// ===== test 100 =====
testNum = 100;
state = {
msg : "the message",
title : "the title",
textValue : "inuser",
passValue : "inpass",
};
+ action = {
+ buttonClick : "ok",
+ textField : "outuser",
+ passField : "outpass",
+ };
uname.value = "inuser";
pword.value = "inpass";
startCallbackTimer();
isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://nonexample.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, uname, pword);
ok(isOk, "Checking dialog return value (accept)");
ok(didDialog, "handleDialog was invoked");
is(uname.value, "outuser", "Checking returned username");
@@ -917,16 +763,19 @@ function doTests() {
// ===== test 101 =====
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "inuser",
passValue : "inpass",
};
+ action = {
+ buttonClick : "cancel",
+ };
uname.value = "inuser";
pword.value = "inpass";
startCallbackTimer();
isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://nonexample.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, uname, pword);
ok(!isOk, "Checking dialog return value (cancel)");
ok(didDialog, "handleDialog was invoked");
@@ -934,16 +783,19 @@ function doTests() {
// test filling in existing password-only login
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "",
passValue : "examplepass",
};
+ action = {
+ buttonClick : "ok",
+ };
uname.value = null;
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://example.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, uname, pword);
ok(isOk, "Checking dialog return value (accept)");
ok(didDialog, "handleDialog was invoked");
is(uname.value, "", "Checking returned username");
@@ -954,16 +806,19 @@ function doTests() {
testNum++;
// user2name/user2pass would also be valid to fill here.
state = {
msg : "the message",
title : "the title",
textValue : "user1name",
passValue : "user1pass",
};
+ action = {
+ buttonClick : "ok",
+ };
uname.value = null;
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://example2.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, uname, pword);
ok(isOk, "Checking dialog return value (accept)");
ok(didDialog, "handleDialog was invoked");
ok(uname.value == "user1name" || uname.value == "user2name", "Checking returned username");
@@ -973,16 +828,19 @@ function doTests() {
// test filling in existing login (user1 from multiple selection)
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "user1name",
passValue : "user1pass",
};
+ action = {
+ buttonClick : "ok",
+ };
uname.value = "user1name";
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://example2.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, uname, pword);
ok(isOk, "Checking dialog return value (accept)");
ok(didDialog, "handleDialog was invoked");
is(uname.value, "user1name", "Checking returned username");
@@ -992,16 +850,19 @@ function doTests() {
// test filling in existing login (user2 from multiple selection)
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "user2name",
passValue : "user2pass",
};
+ action = {
+ buttonClick : "ok",
+ };
uname.value = "user2name";
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://example2.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, uname, pword);
ok(isOk, "Checking dialog return value (accept)");
ok(didDialog, "handleDialog was invoked");
is(uname.value, "user2name", "Checking returned username");
@@ -1011,16 +872,20 @@ function doTests() {
// test changing password
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "user2name",
passValue : "user2pass",
};
+ action = {
+ buttonClick : "ok",
+ passField : "NEWuser2pass",
+ };
uname.value = "user2name";
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://example2.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, uname, pword);
ok(isOk, "Checking dialog return value (accept)");
ok(didDialog, "handleDialog was invoked");
is(uname.value, "user2name", "Checking returned username");
@@ -1030,16 +895,20 @@ function doTests() {
// test changing password (back to original value)
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "user2name",
passValue : "NEWuser2pass",
};
+ action = {
+ buttonClick : "ok",
+ passField : "user2pass",
+ };
uname.value = "user2name";
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://example2.com",
Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, uname, pword);
ok(isOk, "Checking dialog return value (accept)");
ok(didDialog, "handleDialog was invoked");
is(uname.value, "user2name", "Checking returned username");
@@ -1049,16 +918,21 @@ function doTests() {
// 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 : "",
};
+ action = {
+ buttonClick : "ok",
+ textField : "fill2user",
+ passField : "fill2pass",
+ };
uname.value = null;
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "example2.com:80 (somerealm)",
Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, uname, pword);
ok(isOk, "Checking dialog return value (accept)");
ok(didDialog, "handleDialog was invoked");
is(uname.value, "fill2user", "Checking returned username");
@@ -1068,16 +942,21 @@ function doTests() {
// 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 : "",
};
+ action = {
+ buttonClick : "ok",
+ textField : "fill2user",
+ passField : "fill2pass",
+ };
uname.value = null;
pword.value = null;
startCallbackTimer();
isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "example2.com:80 (somerealm)",
Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, uname, pword);
ok(isOk, "Checking dialog return value (accept)");
ok(didDialog, "handleDialog was invoked");
is(uname.value, "fill2user", "Checking returned username");
@@ -1107,16 +986,21 @@ 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",
};
+ action = {
+ buttonClick : "ok",
+ textField : "outuser",
+ passField : "outpass",
+ };
authinfo.username = "inuser";
authinfo.password = "inpass";
authinfo.realm = "some realm";
startCallbackTimer();
isOk = prompter2.promptAuth(channel1, level, authinfo);
ok(isOk, "Checking dialog return value (accept)");
@@ -1127,31 +1011,37 @@ 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",
};
+ action = {
+ buttonClick : "cancel",
+ };
startCallbackTimer();
isOk = prompter2.promptAuth(channel1, level, authinfo);
ok(!isOk, "Checking dialog return value (cancel)");
ok(didDialog, "handleDialog was invoked");
// ===== 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",
};
+ action = {
+ buttonClick : "ok",
+ };
authinfo.username = "";
authinfo.password = "";
authinfo.realm = "http://example.com";
startCallbackTimer();
isOk = prompter2.promptAuth(channel1, level, authinfo);
ok(isOk, "Checking dialog return value (accept)");
@@ -1164,16 +1054,19 @@ function doTests() {
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",
};
+ action = {
+ buttonClick : "ok",
+ };
authinfo.username = "";
authinfo.password = "";
authinfo.realm = "http://example2.com";
startCallbackTimer();
isOk = prompter2.promptAuth(channel2, level, authinfo);
ok(isOk, "Checking dialog return value (accept)");
@@ -1186,16 +1079,22 @@ function doTests() {
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",
};
+ // enter one of the known logins, test 504+505 exercise the two possible states.
+ action = {
+ buttonClick : "ok",
+ textField : "user1name",
+ passField : "user1pass",
+ };
authinfo.username = "";
authinfo.password = "";
authinfo.realm = "http://example2.com";
startCallbackTimer();
isOk = prompter2.promptAuth(channel2, level, authinfo);
ok(isOk, "Checking dialog return value (accept)");
@@ -1208,16 +1107,22 @@ function doTests() {
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",
};
+ // enter one of the known logins, test 504+505 exercise the two possible states.
+ action = {
+ buttonClick : "ok",
+ textField : "user2name",
+ passField : "user2pass",
+ };
authinfo.username = "";
authinfo.password = "";
authinfo.realm = "http://example2.com";
dumpNotifications();
startCallbackTimer();
isOk = prompter2.promptAuth(channel2, level, authinfo);
@@ -1231,16 +1136,22 @@ function doTests() {
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",
};
+ // force to user2, and change the password
+ action = {
+ buttonClick : "ok",
+ textField : "user2name",
+ passField : "NEWuser2pass",
+ };
authinfo.username = "";
authinfo.password = "";
authinfo.realm = "http://example2.com";
dumpNotifications();
startCallbackTimer();
isOk = prompter2.promptAuth(channel2, level, authinfo);
@@ -1254,16 +1165,22 @@ function doTests() {
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",
};
+ // force to user2, and change the password back
+ action = {
+ buttonClick : "ok",
+ textField : "user2name",
+ passField : "user2pass",
+ };
authinfo.username = "";
authinfo.password = "";
authinfo.realm = "http://example2.com";
dumpNotifications();
startCallbackTimer();
isOk = prompter2.promptAuth(channel2, level, authinfo);
@@ -1276,16 +1193,19 @@ function doTests() {
// 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",
};
+ action = {
+ buttonClick : "ok",
+ };
proxyAuthinfo.username = "";
proxyAuthinfo.password = "";
proxyAuthinfo.realm = "Proxy Realm";
proxyAuthinfo.flags = Ci.nsIAuthInformation.AUTH_PROXY;
dumpNotifications();
var time1 = pwmgr.findLogins({}, mozproxy, null, "Proxy Realm")[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
startCallbackTimer();
@@ -1323,16 +1243,19 @@ function doTests() {
// 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",
};
+ action = {
+ buttonClick : "ok",
+ };
proxyAuthinfo.username = "";
proxyAuthinfo.password = "";
proxyAuthinfo.realm = "Proxy Realm";
proxyAuthinfo.flags = (Ci.nsIAuthInformation.AUTH_PROXY | Ci.nsIAuthInformation.PREVIOUS_FAILED);
time1 = pwmgr.findLogins({}, mozproxy, null, "Proxy Realm")[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
startCallbackTimer();
@@ -1349,16 +1272,19 @@ function doTests() {
// test proxy login (with autologin), ensure it prompts in Private Browsing mode.
testNum++;
state = {
msg : "the message",
title : "the title",
textValue : "proxuser",
passValue : "proxpass",
};
+ action = {
+ buttonClick : "ok",
+ };
proxyAuthinfo.username = "";
proxyAuthinfo.password = "";
proxyAuthinfo.realm = "Proxy Realm";
proxyAuthinfo.flags = Ci.nsIAuthInformation.AUTH_PROXY;
prefs.clearUserPref("signon.autologin.proxy");
@@ -1378,16 +1304,19 @@ 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",
};
+ action = {
+ buttonClick : "ok",
+ };
startCallbackTimer();
iframe.src = "authenticate.sjs?user=mochiuser1&pass=mochipass1";
// ...remaining tests are driven by handleLoad()...
}
</script>
</pre>
</body>