New issue
Advanced search Search tips

Issue 897185 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 867414
Owner:
Closed: Oct 23
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 3
Type: Bug
Proj-Servicification



Sign in to add a comment

g_network_change_notifier shouldn't be initialized in every test

Project Member Reported by sebmarchand@chromium.org, Oct 19

Issue description

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|.
 
Components: -Internals>Network Internals>Network>Connectivity
Components: -Internals>Network>Connectivity Internals>Services>Network
Components: Internals>Network>Connectivity
Owner: sebmarchand@chromium.org
FYI I've started working on this
Mergedinto: 867414
Status: Duplicate (was: Untriaged)

Sign in to add a comment