Move fxv8_unittests.{cpp,h} and fxgc_unittests.{cpp,h} to testing/

Otherwise files like xfa/fxfa/parser/cxfa_node_unittest.cpp can't
include fxgc_unittest.h, because currently fxgc_unittest.h is part
of a pdfium_unittest_source_set("unittests") clause, which doesn't
make it available.

This makes sense, in some sense, because these files don't contain
individual tests in themselves, but rather classes from which other
tests may inherit.

-- kill some blank lines.

Change-Id: I9c1e2bfccb30c541db0d7c3de29f2da2527f21ea
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/71870
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/fxjs/BUILD.gn b/fxjs/BUILD.gn
index 10cb49b..bb85b32 100644
--- a/fxjs/BUILD.gn
+++ b/fxjs/BUILD.gn
@@ -223,16 +223,12 @@
       "cjs_publicmethods_unittest.cpp",
       "cjs_util_unittest.cpp",
       "fx_date_helpers_unittest.cpp",
-      "fxv8_unittest.cpp",
-      "fxv8_unittest.h",
     ]
     configs = [ "//v8:external_startup_data" ]
     deps = [ ":fxjs" ]
     pdfium_root_dir = "../"
     if (pdf_enable_xfa) {
       sources += [
-        "gc/fxgc_unittest.cpp",
-        "gc/fxgc_unittest.h",
         "gc/gced_tree_node_unittest.cpp",
         "gc/heap_unittest.cpp",
       ]
diff --git a/fxjs/cfx_v8_unittest.cpp b/fxjs/cfx_v8_unittest.cpp
index c969009..8deda61 100644
--- a/fxjs/cfx_v8_unittest.cpp
+++ b/fxjs/cfx_v8_unittest.cpp
@@ -7,7 +7,7 @@
 #include <cmath>
 #include <memory>
 
-#include "fxjs/fxv8_unittest.h"
+#include "testing/fxv8_unittest.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace {
diff --git a/fxjs/cfxjs_engine_unittest.cpp b/fxjs/cfxjs_engine_unittest.cpp
index b1a2f85..c4644bf 100644
--- a/fxjs/cfxjs_engine_unittest.cpp
+++ b/fxjs/cfxjs_engine_unittest.cpp
@@ -7,7 +7,7 @@
 #include <memory>
 
 #include "fxjs/cjs_object.h"
-#include "fxjs/fxv8_unittest.h"
+#include "testing/fxv8_unittest.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 class FXJSEngineUnitTest : public FXV8UnitTest {
diff --git a/fxjs/gc/gced_tree_node_unittest.cpp b/fxjs/gc/gced_tree_node_unittest.cpp
index 2fbc592..396493d 100644
--- a/fxjs/gc/gced_tree_node_unittest.cpp
+++ b/fxjs/gc/gced_tree_node_unittest.cpp
@@ -7,8 +7,8 @@
 #include <map>
 
 #include "core/fxcrt/observed_ptr.h"
-#include "fxjs/gc/fxgc_unittest.h"
 #include "fxjs/gc/heap.h"
+#include "testing/fxgc_unittest.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "testing/v8_test_environment.h"
 #include "third_party/base/stl_util.h"
diff --git a/fxjs/gc/heap_unittest.cpp b/fxjs/gc/heap_unittest.cpp
index 33e1bb1..685c357 100644
--- a/fxjs/gc/heap_unittest.cpp
+++ b/fxjs/gc/heap_unittest.cpp
@@ -8,7 +8,7 @@
 #include <set>
 
 #include "core/fxcrt/autorestorer.h"
-#include "fxjs/gc/fxgc_unittest.h"
+#include "testing/fxgc_unittest.h"
 #include "testing/gtest/include/gtest/gtest.h"
 #include "third_party/base/stl_util.h"
 #include "v8/include/cppgc/allocation.h"
diff --git a/testing/BUILD.gn b/testing/BUILD.gn
index 4ebfef0..12c5114 100644
--- a/testing/BUILD.gn
+++ b/testing/BUILD.gn
@@ -36,7 +36,6 @@
   ]
   configs += [ "../:pdfium_core_config" ]
   visibility = [ "../*" ]
-
   if (pdf_enable_v8) {
     sources += [
       "v8_initializer.cpp",
@@ -63,7 +62,6 @@
     "//testing/gtest",
   ]
   configs += [ "../:pdfium_core_config" ]
-
   if (pdf_enable_v8) {
     sources += [
       "v8_test_environment.cpp",
@@ -75,7 +73,6 @@
     ]
     configs += [ "//v8:external_startup_data" ]
   }
-
   if (pdf_enable_xfa) {
     sources += [
       "xfa_test_environment.cpp",
@@ -90,10 +87,30 @@
 
 source_set("unit_test_support") {
   testonly = true
+  sources = []
+  deps = []
+  configs += [ "../:pdfium_core_config" ]
   public_deps = [
     ":test_environments",
     ":test_support",
   ]
+  if (pdf_enable_v8) {
+    sources += [
+      "fxv8_unittest.cpp",
+      "fxv8_unittest.h",
+    ]
+    deps += [
+      "../fxjs",
+      "//testing/gtest",
+    ]
+    configs += [ "//v8:external_startup_data" ]
+    if (pdf_enable_xfa) {
+      sources += [
+        "fxgc_unittest.cpp",
+        "fxgc_unittest.h",
+      ]
+    }
+  }
 }
 
 source_set("embedder_test_support") {
@@ -124,7 +141,6 @@
   ]
   configs += [ "../:pdfium_core_config" ]
   visibility = [ "../*" ]
-
   if (pdf_enable_v8) {
     sources += [
       "external_engine_embedder_test.cpp",
@@ -138,7 +154,6 @@
       "//v8:v8_libplatform",
     ]
     configs += [ "//v8:external_startup_data" ]
-
     if (pdf_enable_xfa) {
       sources += [
         "xfa_js_embedder_test.cpp",
diff --git a/fxjs/gc/fxgc_unittest.cpp b/testing/fxgc_unittest.cpp
similarity index 94%
rename from fxjs/gc/fxgc_unittest.cpp
rename to testing/fxgc_unittest.cpp
index 74a329b..3c54ee6 100644
--- a/fxjs/gc/fxgc_unittest.cpp
+++ b/testing/fxgc_unittest.cpp
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "fxjs/gc/fxgc_unittest.h"
+#include "testing/fxgc_unittest.h"
 
 #include "fxjs/gc/heap.h"
 #include "testing/gtest/include/gtest/gtest.h"
diff --git a/fxjs/gc/fxgc_unittest.h b/testing/fxgc_unittest.h
similarity index 76%
rename from fxjs/gc/fxgc_unittest.h
rename to testing/fxgc_unittest.h
index 6467e3b..0e6515b 100644
--- a/fxjs/gc/fxgc_unittest.h
+++ b/testing/fxgc_unittest.h
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef FXJS_GC_FXGC_UNITTEST_H_
-#define FXJS_GC_FXGC_UNITTEST_H_
+#ifndef TESTING_FXGC_UNITTEST_H_
+#define TESTING_FXGC_UNITTEST_H_
 
-#include "fxjs/fxv8_unittest.h"
 #include "fxjs/gc/heap.h"
+#include "testing/fxv8_unittest.h"
 
 class FXGCUnitTest : public FXV8UnitTest {
  public:
@@ -23,4 +23,4 @@
   FXGCScopedHeap heap_;
 };
 
-#endif  // FXJS_GC_FXGC_UNITTEST_H_
+#endif  // TESTING_FXGC_UNITTEST_H_
diff --git a/fxjs/fxv8_unittest.cpp b/testing/fxv8_unittest.cpp
similarity index 94%
rename from fxjs/fxv8_unittest.cpp
rename to testing/fxv8_unittest.cpp
index 509178a..e9f9d5c 100644
--- a/fxjs/fxv8_unittest.cpp
+++ b/testing/fxv8_unittest.cpp
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "fxjs/fxv8_unittest.h"
+#include "testing/fxv8_unittest.h"
 
 #include "fxjs/cfx_v8.h"
 #include "v8/include/v8.h"
diff --git a/fxjs/fxv8_unittest.h b/testing/fxv8_unittest.h
similarity index 87%
rename from fxjs/fxv8_unittest.h
rename to testing/fxv8_unittest.h
index e7390e0..d80b21e 100644
--- a/fxjs/fxv8_unittest.h
+++ b/testing/fxv8_unittest.h
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#ifndef FXJS_FXV8_UNITTEST_H_
-#define FXJS_FXV8_UNITTEST_H_
+#ifndef TESTING_FXV8_UNITTEST_H_
+#define TESTING_FXV8_UNITTEST_H_
 
 #include <memory>
 
@@ -34,4 +34,4 @@
   std::unique_ptr<v8::Isolate, V8IsolateDeleter> isolate_;
 };
 
-#endif  // FXJS_FXV8_UNITTEST_H_
+#endif  // TESTING_FXV8_UNITTEST_H_