gecko-dev/netwerk/test
Francois Marier e98e918836 Bug 1461515 - Fix and expand tracking annotation test. r=dimi
Here's a summary of things that were wrong about this test:

1. It was setting urlclassifier.trackingTable only to be overwritten
   later by addTestTrackers().
2. It was using an http event which fires before the classification has
   been done.
3. It didn't disable tailing, which interferes with lowering the priority of
   XHRs.
4. It was not testing that non-annotated or whitelisted resources would not
   have their priority lowered.

I added more test cases both to ensure that the correct list
(urlclassifier.trackingAnnotationTable) is used but also to ensure that
whitelisted or non-blacklisted URLs preserve the normal priority (point #4 above).

I found that XHRs do not get their priority lowered because of this flag:

  https://searchfox.org/mozilla-central/rev/d47c829065767b6f36d29303d650bffb7c4f94a3/netwerk/base/nsChannelClassifier.cpp#221

which gets set here:

  https://searchfox.org/mozilla-central/rev/d47c829065767b6f36d29303d650bffb7c4f94a3/dom/xhr/XMLHttpRequestMainThread.cpp#2548

and so I had to disable tailing in the test (point #3 above).

There was also a problem where the test was resetting the prefs too early
because we were not actually waiting for the classification to finish.

We would wait for the following event: http-on-opening-request

  https://searchfox.org/mozilla-central/rev/d47c829065767b6f36d29303d650bffb7c4f94a3/netwerk/protocol/http/nsIHttpProtocolHandler.idl#85

whereas maybe a more appropriate one would be http-on-before-connect:

  https://searchfox.org/mozilla-central/rev/d47c829065767b6f36d29303d650bffb7c4f94a3/netwerk/protocol/http/nsIHttpProtocolHandler.idl#103

since that is triggerred after annotations (point #2 above):

  https://searchfox.org/mozilla-central/rev/d47c829065767b6f36d29303d650bffb7c4f94a3/netwerk/protocol/http/nsHttpChannel.cpp#6614

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

--HG--
extra : moz-landing-system : lando
2018-08-01 11:52:03 +00:00
..
browser Bug 1463291: Move docShell getter from Document to Window. r=bz 2018-05-21 16:58:23 -07:00
crashtests
gtest Bug 1448034 - Part 2: Lazily create ProxyResolution thread. r=bagder 2018-07-16 16:05:39 -07: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
unit Bug 1461515 - Fix and expand tracking annotation test. r=dimi 2018-08-01 11:52:03 +00:00
unit_ipc Bug 1460609 - Cookies are for parents r=mayhemer 2018-06-07 14:12:37 +02:00
moz.build Bug 1394734 - Replace CONFIG['GNU_C*'] by CONFIG['CC_TYPE'] r=glandium 2017-12-07 22:09:15 +01: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
TestUDPSocket.cpp Bug 1453795 - Necko - Initialize member fields in classes/ structures. r=michal 2018-06-14 11:19:07 +03:00