Register FuzzTests in non-single-process-mode tests.

Previous CLs initialize FuzzTests within Chromium test suites. However,
in some flows, some test suites fork into multiple processes, and the
previous InitFuzzTest code wasn't being reached in this mode, hence no
fuzztests were run. This calls the same initialization code from the
flow which is used in multi-process test mode.

Specifically, imagine we have a FUZZ_TEST in components_unittests called
Snippets.BuildSnippetNeverCrashes.

Previously, this would have run the unit tests but not the fuzz test:
components_unittests "--gtest_filter=Snippets.*"
whereas this would have run both unit tests and fuzz tests:
components_unittests --single-process-tests "--gtest_filter=Snippets.*"

This CL ensures that either mode reaches the fuzz test.

This needs to move the FuzzTest initialization code into //base/test
such that we can use base::NoDestructor in order to be compliant with
Chrome coding standards.

Cq-Include-Trybots: luci.chromium.try:linux-centipede-asan-rel
Cq-Include-Trybots: luci.chromium.try:linux-libfuzzer-asan-rel
Cq-Include-Trybots: luci.chromium.try:win-libfuzzer-asan-rel
Bug: 40286211
Change-Id: I8f478ed4cc2aa974d74bd16570d1b56dd921c69a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5614450
Commit-Queue: Adrian Taylor <adetaylor@chromium.org>
Reviewed-by: Ben Pastene <bpastene@chromium.org>
Reviewed-by: Titouan Rigoudy <titouan@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1321626}
NOKEYCHECK=True
GitOrigin-RevId: 7f7a7552789a6c3a89703b63748d35516d0f440a
4 files changed
tree: 5b39f5a6f1f68b6691130bc6f6d78b067b748b5d
  1. BUILD.gn
  2. OWNERS
  3. README.chromium