Every test in unit_tests that doesn't explicitly require g_network_change_notifier need to add some extra logic to make sure that it doesn't leak once the test finish to execute. E.g. the first thing that's being done in RenderViewHostTestHarness::SetUp is to create a mock NetworkChangeNotifier and store it in a unique_ptr to make sure that this gets cleared once the test finishes (https://cs.chromium.org/chromium/src/content/public/test/test_renderer_host.cc?l=268&rcl=c6082cfb512334508c34df89840e3d74a80cca50).
I really think that the logic should be the opposite here, only test and binaries that need it should set |g_network_change_notifier|.
I'm proposing to add a new ScopedEnableNetworkChangeNotifier class in net/base/network_change_notifier.h that will allow to explicitly enable the initialization of |g_network_change_notifier|.
Comment 1 by svaldez@chromium.org
, Oct 19