mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-22 17:55:50 +00:00
e98e918836
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 |
||
---|---|---|
.. | ||
browser | ||
crashtests | ||
gtest | ||
httpserver | ||
mochitests | ||
reftest | ||
unit | ||
unit_ipc | ||
moz.build | ||
TestBind.cpp | ||
TestCommon.h | ||
TestCookie.cpp | ||
TestNamedPipeService.cpp | ||
TestUDPSocket.cpp |