Bug 1258912 - Enable the no-undef rule in pwmgr tests. r=jaws

Differential Revision: https://phabricator.services.mozilla.com/D18168

--HG--
extra : rebase_source : 0bc63cc16e10a0a4ce962c243e0fe11a9a9d3c4f
This commit is contained in:
Matthew Noorenberghe 2019-02-01 12:40:05 -08:00
Родитель dbc2f6e676
Коммит 8c24e0d946
30 изменённых файлов: 87 добавлений и 78 удалений

Просмотреть файл

@ -3,10 +3,18 @@
module.exports = {
"extends": [
"plugin:mozilla/mochitest-test",
"plugin:mozilla/chrome-test"
],
"globals": {
"promptDone": true,
"startTest": true,
// Make no-undef happy with our runInParent mixed environments since you
// can't indicate a single function is a new env.
"assert": true,
"addMessageListener": true,
"sendAsyncMessage": true,
},
"rules": {
"brace-style": ["error", "1tbs", {"allowSingleLine": false}],
"no-undef": "off",
},
};

Просмотреть файл

@ -9,7 +9,7 @@
<script>
// Ignore the '?' and split on |
[username, password, features, autoClose] = window.location.search.substring(1).split("|");
let [username, password, features, autoClose] = window.location.search.substring(1).split("|");
var url = "subtst_notifications_11_popup.html?" + username + "|" + password;
var popupWin = window.open(url, "subtst_11", features);

Просмотреть файл

@ -15,7 +15,7 @@
<script>
function submitForm() {
// Get the password from the query string (exclude '?').
[username, password] = window.location.search.substring(1).split("|");
let [username, password] = window.location.search.substring(1).split("|");
userField.value = username;
passField.value = password;
form.submit();

Просмотреть файл

@ -7,9 +7,9 @@ prefs =
support-files =
../../../prompts/test/chromeScript.js
../../../prompts/test/prompt_common.js
!/toolkit/components/prompts/test/prompt_common.js
../../../satchel/test/parent_utils.js
../../../satchel/test/satchel_common.js
!/toolkit/components/satchel/test/satchel_common.js
../blank.html
../browser/form_autofocus_js.html
../browser/form_basic.html

Просмотреть файл

@ -12,13 +12,13 @@ const TESTS_DIR = "/tests/toolkit/components/passwordmgr/test/";
function $_(formNum, name) {
var form = document.getElementById("form" + formNum);
if (!form) {
logWarning("$_ couldn't find requested form " + formNum);
ok(false, "$_ couldn't find requested form " + formNum);
return null;
}
var element = form.children.namedItem(name);
if (!element) {
logWarning("$_ couldn't find requested element " + name);
ok(false, "$_ couldn't find requested element " + name);
return null;
}
@ -29,7 +29,7 @@ function $_(formNum, name) {
// that we don't end up with tests that mistakenly pass.
if (element.getAttribute("name") != name) {
logWarning("$_ got confused.");
ok(false, "$_ got confused.");
return null;
}

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="satchel_common.js"></script>
<script type="text/javascript" src="../../../satchel/test/satchel_common.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -6,14 +6,13 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="satchel_common.js"></script>
<script type="text/javascript" src="../../../satchel/test/satchel_common.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<script>
SpecialPowers.pushPrefEnv({"set": [["security.allow_eval_with_system_principal",
true]]});

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="satchel_common.js"></script>
<script type="text/javascript" src="../../../satchel/test/satchel_common.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="satchel_common.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="satchel_common.js"></script>
<script type="text/javascript" src="../../../satchel/test/satchel_common.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="satchel_common.js"></script>
<script type="text/javascript" src="../../../satchel/test/satchel_common.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
@ -455,8 +455,7 @@ add_task(async function test_form1_delete() {
// Delete the first entry (of 4), "tempuser1"
synthesizeKey("KEY_ArrowDown");
var numLogins;
numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
let numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
is(numLogins, 5, "Correct number of logins before deleting one");
let countChangedPromise = notifyMenuChanged(3);
@ -499,7 +498,7 @@ add_task(async function test_form1_delete_second() {
synthesizeKey("KEY_ArrowDown");
synthesizeKey("KEY_Delete", {shiftKey: true});
checkACForm("", "");
numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
let numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
is(numLogins, 3, "Correct number of logins after deleting one");
synthesizeKey("KEY_Enter");
await promiseFormsProcessed();
@ -531,7 +530,7 @@ add_task(async function test_form1_delete_last() {
synthesizeKey("KEY_ArrowDown");
synthesizeKey("KEY_Delete", {shiftKey: true});
checkACForm("", "");
numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
let numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
is(numLogins, 2, "Correct number of logins after deleting one");
synthesizeKey("KEY_Enter");
await promiseFormsProcessed();
@ -562,7 +561,7 @@ add_task(async function test_form1_check_only_entry_remaining() {
synthesizeKey("KEY_ArrowDown");
synthesizeKey("KEY_Delete", {shiftKey: true});
checkACForm("", "");
numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
let numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
is(numLogins, 1, "Correct number of logins after deleting one");
// remove the login that's not shown in the list.

Просмотреть файл

@ -14,14 +14,14 @@ runChecksAfterCommonInit(() => startTest());
runInParent(function setup() {
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
login1 = Cc["@mozilla.org/login-manager/loginInfo;1"].
createInstance(Ci.nsILoginInfo);
login2 = Cc["@mozilla.org/login-manager/loginInfo;1"].
createInstance(Ci.nsILoginInfo);
login3 = Cc["@mozilla.org/login-manager/loginInfo;1"].
createInstance(Ci.nsILoginInfo);
login4 = Cc["@mozilla.org/login-manager/loginInfo;1"].
createInstance(Ci.nsILoginInfo);
let login1 = Cc["@mozilla.org/login-manager/loginInfo;1"].
createInstance(Ci.nsILoginInfo);
let login2 = Cc["@mozilla.org/login-manager/loginInfo;1"].
createInstance(Ci.nsILoginInfo);
let login3 = Cc["@mozilla.org/login-manager/loginInfo;1"].
createInstance(Ci.nsILoginInfo);
let login4 = Cc["@mozilla.org/login-manager/loginInfo;1"].
createInstance(Ci.nsILoginInfo);
login1.init("http://mochi.test:8888", "http://bug600551-1", null,
"testuser@example.com", "testpass1", "", "");

Просмотреть файл

@ -21,8 +21,8 @@ runInParent(() => {
//
// Note: pwlogin2 is deleted at the end of the test.
pwlogin1 = new nsLoginInfo();
pwlogin2 = new nsLoginInfo();
let pwlogin1 = new nsLoginInfo();
let pwlogin2 = new nsLoginInfo();
pwlogin1.init("http://mochi.test:8888", "http://mochi.test:1111", null,
"", "1234", "uname", "pword");

Просмотреть файл

@ -80,8 +80,8 @@
let mm = runInParent(() => {
const { classes: parentCc, interfaces: parentCi, utils: parentCu } = Components;
parentCu.import("resource://gre/modules/Services.jsm");
parentCu.import("resource://gre/modules/NetUtil.jsm");
let {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
let {NetUtil} = ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
parentCu.import("resource://gre/modules/Timer.jsm");
parentCu.import("resource://gre/modules/XPCOMUtils.jsm");

Просмотреть файл

@ -40,7 +40,7 @@ function doxhr(URL, user, pass, next) {
};
xhr.onerror = function() {
ok(false, "request passed");
finishTest();
SimpleTest.finish();
};
xhr.send();
}

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="satchel_common.js"></script>
<script type="text/javascript" src="../../../satchel/test/satchel_common.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -74,7 +74,8 @@ const TESTCASES = [
add_task(async function test() {
let loginFrame = document.getElementById("loginFrame");
var android = navigator.appVersion.includes("Android");
let waitTime;
let android = navigator.appVersion.includes("Android");
if (android) {
// intermittent failures on Android Debug at 5 seconds
waitTime = 10000;

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="satchel_common.js"></script>
<script type="text/javascript" src="../../../satchel/test/satchel_common.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
@ -513,7 +513,7 @@ add_task(async function test_form1_delete_second() {
synthesizeKey("KEY_ArrowDown");
synthesizeKey("KEY_Delete", {shiftKey: true});
checkACForm("", "");
numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
let numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
is(numLogins, 3, "Correct number of logins after deleting one");
synthesizeKey("KEY_Enter");
await promiseFormsProcessed();
@ -547,7 +547,7 @@ add_task(async function test_form1_delete_last() {
synthesizeKey("KEY_ArrowDown");
synthesizeKey("KEY_Delete", {shiftKey: true});
checkACForm("", "");
numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
let numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
is(numLogins, 2, "Correct number of logins after deleting one");
synthesizeKey("KEY_Enter");
await promiseFormsProcessed();
@ -580,7 +580,7 @@ add_task(async function test_form1_check_only_entry_remaining() {
synthesizeKey("KEY_ArrowDown");
synthesizeKey("KEY_Delete", {shiftKey: true});
checkACForm("", "");
numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
let numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
is(numLogins, 1, "Correct number of logins after deleting one");
// remove the login that's not shown in the list.

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="satchel_common.js"></script>
<script type="text/javascript" src="../../../satchel/test/satchel_common.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<script type="text/javascript" src="prompt_common.js"></script>
<script type="text/javascript" src="../../../prompts/test/prompt_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="satchel_common.js"></script>
<script type="text/javascript" src="../../../satchel/test/satchel_common.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<script type="text/javascript" src="prompt_common.js"></script>
<script type="text/javascript" src="../../../prompts/test/prompt_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>

Просмотреть файл

@ -7,7 +7,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<script type="text/javascript" src="prompt_common.js"></script>
<script type="text/javascript" src="../../../prompts/test/prompt_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
<script class="testbody" type="text/javascript">
@ -21,6 +21,9 @@
// Used by prompt_common.js.
isTabModal = false;
// These are magically defined on the window due to the iframe IDs
/* global iframe1, iframe2a, iframe2b */
let chromeScript = runInParent(SimpleTest.getTestFileURL("pwmgr_common.js"));
/**
@ -194,8 +197,8 @@
let iframe2aDoc = await iframe2aDocPromise;
let iframe2bDoc = await iframe2bDocPromise;
authok1 = iframe1Doc.getElementById("ok").textContent;
proxyok1 = iframe1Doc.getElementById("proxy").textContent;
let authok1 = iframe1Doc.getElementById("ok").textContent;
let proxyok1 = iframe1Doc.getElementById("proxy").textContent;
let authok2a = iframe2aDoc.getElementById("ok").textContent;
let proxyok2a = iframe2aDoc.getElementById("proxy").textContent;
@ -348,8 +351,8 @@
let iframe1Doc = await iframe1DocPromise;
authok1 = iframe1Doc.getElementById("ok").textContent;
proxyok1 = iframe1Doc.getElementById("proxy").textContent;
let authok1 = iframe1Doc.getElementById("ok").textContent;
let proxyok1 = iframe1Doc.getElementById("proxy").textContent;
is(authok1, "FAIL", "WWW Authorization FAILED, frame1");
is(proxyok1, "PASS", "Proxy Authorization OK, frame1");
@ -440,9 +443,9 @@
let iframe1Doc = await iframe1DocPromise;
authok1 = iframe1Doc.getElementById("ok").textContent;
proxyok1 = iframe1Doc.getElementById("proxy").textContent;
footnote = iframe1Doc.getElementById("footnote").textContent;
let authok1 = iframe1Doc.getElementById("ok").textContent;
let proxyok1 = iframe1Doc.getElementById("proxy").textContent;
let footnote = iframe1Doc.getElementById("footnote").textContent;
is(authok1, "FAIL", "WWW Authorization FAILED, frame1");
is(proxyok1, "PASS", "Proxy Authorization OK, frame1");
@ -479,9 +482,9 @@
await handlePrompt(state, action);
let iframe1Doc = await iframe1DocPromise;
authok1 = iframe1Doc.getElementById("ok").textContent;
proxyok1 = iframe1Doc.getElementById("proxy").textContent;
footnote = iframe1Doc.getElementById("footnote").textContent;
let authok1 = iframe1Doc.getElementById("ok").textContent;
let proxyok1 = iframe1Doc.getElementById("proxy").textContent;
let footnote = iframe1Doc.getElementById("footnote").textContent;
is(authok1, "PASS", "WWW Authorization OK, frame1");
is(proxyok1, "PASS", "Proxy Authorization OK, frame1");
@ -493,7 +496,6 @@
// Check we process all challenges sent by server when
// user cancels prompts
let iframe1DocPromise = promiseLoadedContentDoc(iframe1);
expectedDialogs = 5;
iframe1.src = EXAMPLE_COM + "authenticate.sjs?" +
"user=user6name&" +
"pass=user6pass&" +
@ -551,9 +553,9 @@
await handlePrompt(state, action);
let iframe1Doc = await iframe1DocPromise;
authok1 = iframe1Doc.getElementById("ok").textContent;
proxyok1 = iframe1Doc.getElementById("proxy").textContent;
footnote = iframe1Doc.getElementById("footnote").textContent;
let authok1 = iframe1Doc.getElementById("ok").textContent;
let proxyok1 = iframe1Doc.getElementById("proxy").textContent;
let footnote = iframe1Doc.getElementById("footnote").textContent;
is(authok1, "PASS", "WWW Authorization OK, frame1");
is(proxyok1, "PASS", "Proxy Authorization OK, frame1");

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<script type="text/javascript" src="prompt_common.js"></script>
<script type="text/javascript" src="../../../prompts/test/prompt_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<script type="text/javascript" src="prompt_common.js"></script>
<script type="text/javascript" src="../../../prompts/test/prompt_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<script type="text/javascript" src="prompt_common.js"></script>
<script type="text/javascript" src="../../../prompts/test/prompt_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<script type="text/javascript" src="prompt_common.js"></script>
<script type="text/javascript" src="../../../prompts/test/prompt_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
@ -185,9 +185,9 @@ add_task(async function test_autologin() {
proxyAuthinfo.realm = "Proxy Realm";
proxyAuthinfo.flags = Ci.nsIAuthInformation.AUTH_PROXY;
time1 = pwmgr.findLogins({}, mozproxy, null, "Proxy Realm")[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
let time1 = pwmgr.findLogins({}, mozproxy, null, "Proxy Realm")[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
isOk = prompter2.promptAuth(proxyChannel, level, proxyAuthinfo);
time2 = pwmgr.findLogins({}, mozproxy, null, "Proxy Realm")[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
let time2 = pwmgr.findLogins({}, mozproxy, null, "Proxy Realm")[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
ok(isOk, "Checking dialog return value (accept)");
isnot(time1, time2, "Checking that timeLastUsed was updated");
@ -221,11 +221,11 @@ add_task(async function test_autologin_incorrect() {
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;
let time1 = pwmgr.findLogins({}, mozproxy, null, "Proxy Realm")[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
promptDone = handlePrompt(state, action);
isOk = prompter2.promptAuth(proxyChannel, level, proxyAuthinfo);
await promptDone;
time2 = pwmgr.findLogins({}, mozproxy, null, "Proxy Realm")[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
let time2 = pwmgr.findLogins({}, mozproxy, null, "Proxy Realm")[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
ok(isOk, "Checking dialog return value (accept)");
isnot(time1, time2, "Checking that timeLastUsed was updated");

Просмотреть файл

@ -7,7 +7,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="satchel_common.js"></script>
<script type="text/javascript" src="../../../satchel/test/satchel_common.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
@ -122,7 +122,7 @@ add_task(async function test_autofilled() {
removeFocus();
usernameField.value = "testuser";
info("Focus when we don't have an exact match");
shownPromise = promiseACShown();
let shownPromise = promiseACShown();
usernameField.focus();
await shownPromise;
});
@ -137,7 +137,7 @@ add_task(async function test_autofilled_prefilled_un() {
removeFocus();
usernameField.value = "testuser";
info("Focus when we don't have an exact match");
shownPromise = promiseACShown();
let shownPromise = promiseACShown();
usernameField.focus();
await shownPromise;
});
@ -160,7 +160,7 @@ add_task(async function test_autofilled_focused_dynamic() {
removeFocus();
passwordField.value = "test";
info("Focus when we don't have an exact match");
shownPromise = promiseACShown();
let shownPromise = promiseACShown();
usernameField.focus();
await shownPromise;
});
@ -170,7 +170,7 @@ add_task(async function test_autofilled_focused_dynamic() {
add_task(async function test_multiple() {
let usernameField = $_("-multiple", "uname");
info("Fields not filled due to multiple so autocomplete upon focus");
shownPromise = promiseACShown();
let shownPromise = promiseACShown();
usernameField.focus();
await shownPromise;
});
@ -199,7 +199,7 @@ add_task(async function test_multiple_prefilled_un1() {
removeFocus();
usernameField.value = "testuser";
info("Focus when we don't have an exact match");
shownPromise = promiseACShown();
let shownPromise = promiseACShown();
usernameField.focus();
await shownPromise;
});
@ -214,7 +214,7 @@ add_task(async function test_multiple_prefilled_un2() {
removeFocus();
usernameField.value = "testuser";
info("Focus when we don't have an exact match");
shownPromise = promiseACShown();
let shownPromise = promiseACShown();
usernameField.focus();
await shownPromise;
});
@ -237,7 +237,7 @@ add_task(async function test_multiple_prefilled_focused_dynamic() {
removeFocus();
passwordField.value = "test";
info("Focus when we don't have an exact match");
shownPromise = promiseACShown();
let shownPromise = promiseACShown();
usernameField.focus();
await shownPromise;
});

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<script type="text/javascript" src="prompt_common.js"></script>
<script type="text/javascript" src="../../../prompts/test/prompt_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
@ -115,7 +115,7 @@ add_task(async function test1() {
add_task(async function test2() {
// Test correct parenting, by opening another tab in the foreground,
// and making sure the prompt re-focuses the original tab when shown:
newWin = window.open();
let newWin = window.open();
newWin.focus();
let state = {

Просмотреть файл

@ -6,7 +6,7 @@
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="/tests/SimpleTest/AddTask.js"></script>
<script type="text/javascript" src="pwmgr_common.js"></script>
<script type="text/javascript" src="prompt_common.js"></script>
<script type="text/javascript" src="../../../prompts/test/prompt_common.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>