summaryrefslogtreecommitdiffstats
path: root/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html')
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html46
1 files changed, 12 insertions, 34 deletions
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html b/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html
index 429ec2269c..50d94dfbae 100644
--- a/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html
+++ b/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html
@@ -56,7 +56,7 @@
function runNextTest() {
is(gExpectedDialogs, 0, "received expected number of auth dialogs");
mm.sendAsyncMessage("prepareForNextTest");
- mm.addMessageListener("prepareForNextTestDone", function prepared(msg) {
+ mm.addMessageListener("prepareForNextTestDone", function prepared(_msg) {
mm.removeMessageListener("prepareForNextTestDone", prepared);
if (pendingTests.length) {
({expectedDialogs: gExpectedDialogs,
@@ -92,7 +92,7 @@
const pps = parentCc["@mozilla.org/network/protocol-proxy-service;1"].
getService(parentCi.nsIProtocolProxyService);
pps.asyncResolve(channel, 0, {
- async onProxyAvailable(req, uri, pi, status) {
+ async onProxyAvailable(req, uri, pi, _status) {
const mozproxy = "moz-proxy://" + pi.host + ":" + pi.port;
const login1 = parentCc["@mozilla.org/login-manager/loginInfo;1"].
createInstance(parentCi.nsILoginInfo);
@@ -110,54 +110,32 @@
QueryInterface: ChromeUtils.generateQI([parentCi.nsIProtocolProxyCallback]),
});
- addMessageListener("prepareForNextTest", message => {
+ addMessageListener("prepareForNextTest", _message => {
parentCc["@mozilla.org/network/http-auth-manager;1"].
getService(parentCi.nsIHttpAuthManager).
clearAll();
sendAsyncMessage("prepareForNextTestDone");
});
- const modalType = Services.prefs.getIntPref(
- "prompts.modalType.httpAuth"
- );
- const authPromptIsCommonDialog =
- modalType === Services.prompt.MODAL_TYPE_WINDOW
- || (modalType === Services.prompt.MODAL_TYPE_TAB
- && Services.prefs.getBoolPref(
- "prompts.tabChromePromptSubDialog",
- false
- ));
-
- const dialogObserverTopic = authPromptIsCommonDialog
- ? "common-dialog-loaded" : "tabmodal-dialog-loaded";
-
- function dialogObserver(subj, topic, data) {
- if (authPromptIsCommonDialog) {
- subj.Dialog.ui.prompt.document
- .getElementById("commonDialog")
- .acceptDialog();
- } else {
- const prompt = subj.ownerGlobal.gBrowser.selectedBrowser
- .tabModalPromptBox.getPrompt(subj);
- prompt.Dialog.ui.button0.click(); // Accept button
- }
+ const dialogObserverTopic = "common-dialog-loaded";
+
+ function dialogObserver(subj, _topic, _data) {
+ subj.Dialog.ui.prompt.document
+ .getElementById("commonDialog")
+ .acceptDialog();
sendAsyncMessage("promptAccepted");
}
Services.obs.addObserver(dialogObserver, dialogObserverTopic);
- addMessageListener("cleanup", message => {
+ addMessageListener("cleanup", _message => {
Services.obs.removeObserver(dialogObserver, dialogObserverTopic);
sendAsyncMessage("cleanupDone");
});
});
- mm.addMessageListener("promptAccepted", msg => {
- gExpectedDialogs--;
- });
- mm.addMessageListener("setupDone", msg => {
- runNextTest();
- });
+ mm.addMessageListener("promptAccepted", _message => gExpectedDialogs--);
+ mm.addMessageListener("setupDone", _message => runNextTest());
</script>
</body>
</html>