Don't build test_main.cc in chromium builds

Chromium has its own test main() entrypoint.

To ensure that Chromium doesn't panic about memory leaks with the tests that exercise the ICE cases, we have to explicitly call the FreeInternalCompilerErrors() functions in these tests (at least until I can add this to end of Chromium's test main() function)

Change-Id: I2ea5109fcdb5f68f56a19709a1ec35ed72c0f760
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/42025
Reviewed-by: Austin Eng <enga@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index c783aa0..37098ed 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -762,11 +762,13 @@
 # These targets are separated because they are Chromium sources files that
 # can't use the tint_internal config, otherwise Tint's warning flags get
 # applied while compiling a bunch of Chromium's //base (via header inclusion)
-if (build_with_chromium) {
-  source_set("tint_unittests_main") {
-    testonly = true
-    deps = [ ":gmock_and_gtest" ]
+source_set("tint_unittests_main") {
+  testonly = true
+  deps = [ ":gmock_and_gtest" ]
+  if (build_with_chromium) {
     sources = [ "//gpu/tint_unittests_main.cc" ]
+  } else {
+    sources = [ "src/test_main.cc" ]
   }
 }
 
@@ -846,7 +848,6 @@
     "src/scope_stack_test.cc",
     "src/symbol_table_test.cc",
     "src/symbol_test.cc",
-    "src/test_main.cc",
     "src/traits_test.cc",
     "src/transform/bound_array_accessors_test.cc",
     "src/transform/emit_vertex_point_size_test.cc",
@@ -1339,9 +1340,7 @@
     "${tint_spirv_tools_dir}/:spvtools_val",
   ]
 
-  if (build_with_chromium) {
-    deps += [ ":tint_unittests_main" ]
-  }
+  deps += [ ":tint_unittests_main" ]
 
   configs += [
     ":tint_common_config",