1 /* Any copyright is dedicated to the Public Domain.
2 http://creativecommons.org/publicdomain/zero/1.0/ */
6 add_task(async function test_system_wpad() {
7 await openPreferencesViaOpenPreferencesAPI("general", { leaveOpen: true });
9 "chrome://browser/content/preferences/dialogs/connection.xhtml";
11 registerCleanupFunction(function () {
12 Services.prefs.clearUserPref("network.proxy.system_wpad.allowed");
15 Services.prefs.setBoolPref("network.proxy.system_wpad.allowed", true);
16 let dialog = await openAndLoadSubDialog(connectionURL);
17 let dialogElement = dialog.document.getElementById("ConnectionsDialog");
18 let systemWpad = dialog.document.getElementById("systemWpad");
19 Assert.ok(!systemWpad.hidden, "Use system WPAD checkbox should be visible");
20 let dialogClosingPromise = BrowserTestUtils.waitForEvent(
24 dialogElement.cancelDialog();
25 await dialogClosingPromise;
27 Services.prefs.setBoolPref("network.proxy.system_wpad.allowed", false);
28 dialog = await openAndLoadSubDialog(connectionURL);
29 dialogElement = dialog.document.getElementById("ConnectionsDialog");
30 systemWpad = dialog.document.getElementById("systemWpad");
31 Assert.ok(systemWpad.hidden, "Use system WPAD checkbox should be hidden");
32 dialogClosingPromise = BrowserTestUtils.waitForEvent(
36 dialogElement.cancelDialog();
37 await dialogClosingPromise;
39 gBrowser.removeCurrentTab();