Bug 1298193 - Part 2: Switch test_prompt_promptAuth* to add_task. r=Dolske

MozReview-Commit-ID: Es4r5JGFzVW

--HG--
extra : rebase_source : b82927ff4a5262f0b8aef8feba7139b48e6b3519
This commit is contained in:
Matthew Noorenberghe 2016-08-25 23:08:59 -07:00
parent 24db9921eb
commit 277e8620dd
2 changed files with 25 additions and 15 deletions

View File

@ -237,8 +237,7 @@ add_task(function* setup() {
ok(popupNotifications, "Got popupNotifications");
});
add_task(function* test() {
info("===== test 500 =====");
add_task(function* test_accept() {
state = {
msg : "http://example.com is requesting your username and password.\n\nThe site says: “some realm”",
title : "Authentication Required",
@ -270,8 +269,9 @@ add_task(function* test() {
ok(isOk, "Checking dialog return value (accept)");
is(authinfo.username, "outuser", "Checking returned username");
is(authinfo.password, "outpass", "Checking returned password");
});
info("===== test 501 =====");
add_task(function* test_cancel() {
state = {
msg : "http://example.com is requesting your username and password.\n\nThe site says: “some realm”",
title : "Authentication Required",
@ -295,8 +295,9 @@ add_task(function* test() {
yield promptDone;
ok(!isOk, "Checking dialog return value (cancel)");
});
info("===== test 502 =====");
add_task(function* test_pwonly() {
// test filling in password-only login
state = {
msg : "http://example.com is requesting your username and password.\n\nThe site says: “http://example.com”",
@ -327,8 +328,9 @@ add_task(function* test() {
ok(isOk, "Checking dialog return value (accept)");
is(authinfo.username, "", "Checking returned username");
is(authinfo.password, "examplepass", "Checking returned password");
});
info("===== test 503 =====");
add_task(function* test_multipleExisting() {
// test filling in existing login (undetermined from multiple selection)
// user2name/user2pass would also be valid to fill here.
state = {
@ -360,8 +362,9 @@ add_task(function* test() {
ok(isOk, "Checking dialog return value (accept)");
ok(authinfo.username == "user1name" || authinfo.username == "user2name", "Checking returned username");
ok(authinfo.password == "user1pass" || authinfo.password == "user2pass", "Checking returned password");
});
info("===== test 504 =====");
add_task(function* test_multipleExisting2() {
// test filling in existing login (undetermined --> user1)
// user2name/user2pass would also be valid to fill here.
state = {
@ -396,8 +399,9 @@ add_task(function* test() {
ok(isOk, "Checking dialog return value (accept)");
is(authinfo.username, "user1name", "Checking returned username");
is(authinfo.password, "user1pass", "Checking returned password");
});
info("===== test 505 =====");
add_task(function* test_multipleExisting3() {
// test filling in existing login (undetermined --> user2)
// user2name/user2pass would also be valid to fill here.
state = {
@ -433,8 +437,9 @@ add_task(function* test() {
ok(isOk, "Checking dialog return value (accept)");
is(authinfo.username, "user2name", "Checking returned username");
is(authinfo.password, "user2pass", "Checking returned password");
});
info("===== test 506 =====");
add_task(function* test_changingMultiple() {
// test changing a password (undetermined --> user2 w/ newpass)
// user2name/user2pass would also be valid to fill here.
state = {
@ -470,8 +475,9 @@ add_task(function* test() {
ok(isOk, "Checking dialog return value (accept)");
is(authinfo.username, "user2name", "Checking returned username");
is(authinfo.password, "NEWuser2pass", "Checking returned password");
});
info("===== test 507 =====");
add_task(function* test_changingMultiple2() {
// test changing a password (undetermined --> user2 w/ origpass)
// user2name/user2pass would also be valid to fill here.
state = {
@ -507,9 +513,9 @@ add_task(function* test() {
ok(isOk, "Checking dialog return value (accept)");
is(authinfo.username, "user2name", "Checking returned username");
is(authinfo.password, "user2pass", "Checking returned password");
});
info("===== test 1000 =====");
add_task(function* test_iframe() {
state = {
msg : "http://mochi.test:8888 is requesting your username and password.\n\nThe site says: “mochitest”",
title : "Authentication Required",

View File

@ -214,8 +214,9 @@ startup();
add_task(function* setup() {
info("Waiting for startup to complete...");
yield startupComplete;
})
info("===== test 508 =====");
add_task(function* test_noAutologin() {
// test proxy login (default = no autologin), make sure it prompts.
state = {
msg : "The proxy moz-proxy://127.0.0.1:8888 is requesting a username and password.\n\nThe site says: “Proxy Realm”",
@ -250,8 +251,9 @@ add_task(function* setup() {
isnot(time1, time2, "Checking that timeLastUsed was updated");
is(proxyAuthinfo.username, "proxuser", "Checking returned username");
is(proxyAuthinfo.password, "proxpass", "Checking returned password");
});
info("===== test 509 =====");
add_task(function* test_autologin() {
// test proxy login (with autologin)
// Enable the autologin pref.
@ -270,8 +272,9 @@ add_task(function* setup() {
isnot(time1, time2, "Checking that timeLastUsed was updated");
is(proxyAuthinfo.username, "proxuser", "Checking returned username");
is(proxyAuthinfo.password, "proxpass", "Checking returned password");
});
info("===== test 510 =====");
add_task(function* test_autologin_incorrect() {
// test proxy login (with autologin), ensure it prompts after a failed auth.
state = {
msg : "The proxy moz-proxy://127.0.0.1:8888 is requesting a username and password.\n\nThe site says: “Proxy Realm”",
@ -307,8 +310,9 @@ add_task(function* setup() {
isnot(time1, time2, "Checking that timeLastUsed was updated");
is(proxyAuthinfo.username, "proxuser", "Checking returned username");
is(proxyAuthinfo.password, "proxpass", "Checking returned password");
});
info("===== test 511 =====");
add_task(function* test_autologin_private() {
// test proxy login (with autologin), ensure it prompts in Private Browsing mode.
state = {
msg : "the message",