New issue
Advanced search Search tips

Issue 708090 link

Starred by 0 users

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug



Sign in to add a comment

_CheckNoProductionCodeUsingTestOnlyFunctions false positive

Project Member Reported by vabr@chromium.org, Apr 4 2017

Issue description

The CL https://codereview.chromium.org/2714543006/ introduces a function CleanObsoleteHttpDataForPasswordStoreAndPrefsForTesting() and uses it in components/password_manager/core/browser/http_data_cleaner_unittest.cc.

The presubmit check _CheckNoProductionCodeUsingTestOnlyFunctions triggers, saying:

You might be calling functions intended only for testing from
production code.  It is OK to ignore this warning if you know what
you are doing, as the heuristics used to detect the situation are
not perfect.  The commit queue will not block on this warning.
  components/password_manager/core/browser/http_data_cleaner.cc:264
    void CleanObsoleteHttpDataForPasswordStoreAndPrefsForTesting(

It seems that the presubmit check mistakes the function definition for a callsite.
 
Components: -Infra Infra>Client>Chrome
Owner: shenghua...@chromium.org
Status: Assigned (was: Untriaged)
This is because the function definition title takes multiple lines, which means '{' is not in same line of the function name, but is
'CleanObsoleteHttpDataForPasswordStoreAndPrefsForTesting(
   ...
 ) {'

The src/PRESUBMIT.py exclusion_pattern doesn't consider that case
https://codesearch.chromium.org/chromium/src/PRESUBMIT.py?q=exclusion_pattern&l=553

Will work on this when I have time.
Owner: ----
Status: Available (was: Assigned)

Sign in to add a comment