Reland "Build Karma test with Ninja"

This reverts commit 01ac2b90b3893b8355208cbba7ce8ee9c18e53ec.

Reason for revert: Build fixed in Chromium

Original change's description:
> Revert "Build Karma test with Ninja"
>
> This reverts commit 4b654444ed5ef198c8551503670895d67ae7856a.
>
> Reason for revert: Broke the build in Chromium: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket.appspot.com/8887844056671365856/+/steps/compile__with_patch_/0/stdout
>
> Original change's description:
> > Build Karma test with Ninja
> >
> > This instructs Ninja to generate the appropriate files for the test
> > files. It adds a separate `ts_library` definition for tests.
> >
> > Some caveats:
> > - It currently hardcodes the Ninja build output name. We should fix out
> > a solution on how to make this irrespective of build name
> > - The test name has to be renamed to Color_test.ts. While I think this
> > is clearer for code navigation, it was necessary because `ts_library`
> > currently copies to `resources/inspector`, which is not necessary for
> > test files. We could therefore filter these out, based on the files that
> > end with `_test.ts`. We could also add a separate Ninja template,
> > something like `ts_test_library`. Not sure yet what is the best
> > approach.
> >
> > DISABLE_THIRD_PARTY_CHECK=Updating TypeScript configuration
> >
> > Bug: 1011811
> > Change-Id: If7448474e84a013d8d4b00a16743575a12112f58
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2064669
> > Reviewed-by: Jack Franklin <[email protected]>
> > Commit-Queue: Tim van der Lippe <[email protected]>
>
> [email protected],[email protected],[email protected]
>
> Change-Id: I1048a5003b5680b257586cf3720fc5eaddb435d5
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1011811
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2067061
> Reviewed-by: Tim van der Lippe <[email protected]>
> Commit-Queue: Tim van der Lippe <[email protected]>

DISABLE_THIRD_PARTY_CHECK=Reland

Bug: 1011811
Change-Id: I9df8d551a18c7733fca586f504621c18262e941d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2067062
Commit-Queue: Tim van der Lippe <[email protected]>
Reviewed-by: Paul Lewis <[email protected]>
diff --git a/BUILD.gn b/BUILD.gn
index 4c37562..571501e 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -2257,6 +2257,17 @@
   ]
 }
 
+# It is unclear why, but the Android Ninja configuration starts warning about
+# duplicate files being generated. This does not happen for regular Chromium
+# builds. Since we don't run these tests on Android any case, we disable
+# the generation of the tests on Android.
+if (!is_android) {
+  devtools_frontend_resources_deps += [
+    ":copy_karma_conf",
+    "test/unittests/front_end/common",
+  ]
+}
+
 group("devtools_frontend_resources") {
   public_deps = devtools_frontend_resources_deps
 }
@@ -2271,6 +2282,11 @@
   outputs = [ "$resources_out_dir/{{source_file_part}}" ]
 }
 
+copy("copy_karma_conf") {
+  sources = [ "test/unittests/front_end/karma.conf.js" ]
+  outputs = [ "$target_gen_dir/karma.conf.js" ]
+}
+
 copy("copy_htaccess") {
   sources = [ "htaccess" ]
   outputs = [ "$resources_out_dir/.htaccess" ]
@@ -2288,9 +2304,7 @@
 
 copy("copy_lighthouse_locale_files") {
   sources = lighthouse_locale_files
-  outputs = [
-    "$resources_out_dir/lighthouse_worker/lighthouse/locales/{{source_file_part}}",
-  ]
+  outputs = [ "$resources_out_dir/lighthouse_worker/lighthouse/locales/{{source_file_part}}" ]
 }
 
 copy("copy_wasm_deps") {
@@ -2513,25 +2527,6 @@
       "//third_party/node/linux/node-linux-x64/",
     ]
   }
-
-  group("devtools_unittests") {
-    data = [
-      # Needed for isolate script to execute.
-      "front_end/",
-      "karma.conf.js",
-      "node_modules/",
-      "scripts/devtools_paths.py",
-      "scripts/test/",
-      "tests/unittests",
-      "third_party/chrome/",
-      "tsconfig.json",
-      "//testing/scripts/common.py",
-      "//testing/scripts/run_devtools_check.py",
-      "//testing/xvfb.py",
-      "//third_party/node/node.py",
-      "//third_party/node/linux/node-linux-x64/",
-    ]
-  }
 }
 
 # TODO(1018122): remove out-datedly named duplicates
@@ -2571,23 +2566,4 @@
       "//third_party/node/linux/node-linux-x64/",
     ]
   }
-
-  group("devtools_unit_tests") {
-    data = [
-      # Needed for isolate script to execute.
-      "front_end/",
-      "karma.conf.js",
-      "node_modules/",
-      "scripts/devtools_paths.py",
-      "scripts/test/",
-      "tests/unittests",
-      "third_party/chrome/",
-      "tsconfig.json",
-      "//testing/scripts/common.py",
-      "//testing/scripts/run_devtools_check.py",
-      "//testing/xvfb.py",
-      "//third_party/node/node.py",
-      "//third_party/node/linux/node-linux-x64/",
-    ]
-  }
 }