Allow test files to use non-platform suffixes for PRESUBMIT checks.

The current check for deciding if a file is a unittest allows
a strict whitelist of platforms as suffixes. However, when a
unittest file becomes too large, it is useful to split it on
other axes than by platform. This allows a _suffix for a topic
to be used without failing production-only presubmit checks.

In other words, it considers foo_bar_unittest_baz.cc to be a
unittest.

There are many examples of foo_unittest_utils.cc which are used
only by unit tests throughout chromium, but they have been lucky
to avoid using FunctionForTesting type functions. In cc/ we have
run into this problem, so allowing our unittests to be considered
non-production code prevents false positive warnings about our
test files.

NOTRY=true
[email protected]
BUG=

Review URL: https://chromiumcodereview.appspot.com/14317011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195780 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index 6feebd0..9e7bd99a 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -27,10 +27,6 @@
     r".+[\\\/]pnacl_shim\.c$",
 )
 
-# Fragment of a regular expression that matches file name suffixes
-# used to indicate different platforms.
-_PLATFORM_SPECIFIERS = r'(_(android|chromeos|gtk|mac|posix|win))?'
-
 # Fragment of a regular expression that matches C++ and Objective-C++
 # implementation files.
 _IMPLEMENTATION_EXTENSIONS = r'\.(cc|cpp|cxx|mm)$'
@@ -40,8 +36,8 @@
 _TEST_CODE_EXCLUDED_PATHS = (
     r'.*[/\\](fake_|test_|mock_).+%s' % _IMPLEMENTATION_EXTENSIONS,
     r'.+_test_(base|support|util)%s' % _IMPLEMENTATION_EXTENSIONS,
-    r'.+_(api|browser|perf|unit|ui)?test%s%s' % (_PLATFORM_SPECIFIERS,
-                                                 _IMPLEMENTATION_EXTENSIONS),
+    r'.+_(api|browser|perf|unit|ui)?test(_[a-z]+)?%s' %
+        _IMPLEMENTATION_EXTENSIONS,
     r'.+profile_sync_service_harness%s' % _IMPLEMENTATION_EXTENSIONS,
     r'.*[/\\](test|tool(s)?)[/\\].*',
     # At request of folks maintaining this folder.