gecko-dev/netwerk/test
Polly Shaw 226a5beff6 Bug 356831 - Proxy autodiscovery doesn't check DHCP (option 252) r=bagder,valentin
This patch addresses an issue with Firefox's proxy detection on networks which
do not have their a proxy auto-configuration (PAC) file hosted at
http://wpad/wpad.dat, and instead make use of DHCP option 252 for broadcasting
the address of the PAC file. See https://findproxyforurl.com/wpad-introduction/
for an introduction to the protocol.

Prior to this patch, proxy auto-detect missed out the DHCP query stage, and just
 looked for a PAC file at http://wpad/wpad.dat


This patch only addresses the issue for Firefox on Windows, although it defines a
DHCP client interface which could be implemented on other platforms.

The high-level components of this patch are:
 * nsIDHCPClient.idl - this is an interface which has been defined for querying the
   DHCP server.
 * nsPACMan.cpp - where previously when the PAC URL was simply set to a constant of
   http://wpad/wpad.dat, it now dispatches an asynchronous command to the proxy
   thread. The class ExecutePACThreadAction has been augmented to include an
   instruction to 'ConfigureWPAD' (Configure Web-proxy auto-detect), and a new class,
   'ConfigureWPADComplete' has been created to relay the result (the URL of the PAC
   file) back to the nsPACMan object.
 * nsProtocolProxyService.cpp
   Minor changes to reflect the fact that the PAC URL not being set does not always
   mean there is no PAC to be used; instead it could be in the process of being
   detected.
 * TestPACMan.cpp
   This is a new file, and tests only the DHCP auto-detect functionality.
   Some tests use multiple threads, as they test the non-blocking proxy detection.
 * DHCPUtils.cpp
   A class containing the main logic for querying DHCP.
 * WindowsNetworkFunctionsWrapper.cpp
   A very thin wrapper around the Windows API calls needed by DHCPUtils.
   This class was introduced so it could be mocked out in tests.
 * nsWindowsDHCPClient.cpp
 * An implementation of the interface defined in nsIDHCPClient.idl. Fairly thin:
   most logic is implemented in DHCPUtils.
 * TestDHCPUtils.cpp
   Tests for DHCPUtils and nsWindowsDHCPClient

MozReview-Commit-ID: 4xFQz3tOLEx

--HG--
extra : rebase_source : dfd5c588406a8b0d92f91cc8a0038ca722b7140a
2018-06-07 23:07:28 +01:00
..
browser Bug 1472718 - Convert ChromeUtils.requestIOActivity to a Promise - r=baku,valentin 2018-07-06 13:43:08 +02:00
crashtests Bug 675518 - Add crashtest. r=me 2017-10-25 14:58:33 -04:00
gtest Bug 356831 - Proxy autodiscovery doesn't check DHCP (option 252) r=bagder,valentin 2018-06-07 23:07:28 +01:00
httpserver Bug 1405428 - skip-if = verify on xpcshell tests which do not pass test-verify. r=gbrown 2018-06-13 11:34:40 -04:00
mochitests Bug 1405428 - skip-if = verify on mochitests which do not pass test-verify. r=gbrown 2018-06-10 05:01:47 -04:00
reftest Bug 1351548 - Remove reftest-stylo.lists. r=bholley 2017-04-28 11:15:58 +08:00
unit Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-07-03 00:59:47 +03:00
unit_ipc Bug 1460609 - Cookies are for parents r=mayhemer 2018-06-07 14:12:37 +02:00
TestBind.cpp
TestCommon.h Bug 1444490 Declare classses (and one method) in network/ final to reduce virtual function calls r=nwgh 2018-03-09 08:37:18 -06:00
TestCookie.cpp Bug 1452496: gtest for discarding same-site cookies in cross site context. r=dveditz 2018-04-12 12:53:13 +02:00
TestNamedPipeService.cpp Bug 1411728 Resolve warnings in TestNamedPipeService.cpp r=froydnj 2017-10-25 15:27:41 -05:00
TestUDPSocket.cpp Bug 1453795 - Necko - Initialize member fields in classes/ structures. r=michal 2018-06-14 11:19:07 +03:00
moz.build Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium 2017-12-07 22:09:15 +01:00