Switch from check_targets to no_check_targets.

Check all targets, except some third_party targets that are out of our
control. Fix failures for targets that should have been checked, but
were missing from the check_targets list.

Bug: pdfium:1580
Change-Id: Ie6bba77b69ee80c93f1c6539355729ae71574260
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/73015
Reviewed-by: Daniel Hosseinian <dhoss@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/.gn b/.gn
index c974357..4cbf594 100644
--- a/.gn
+++ b/.gn
@@ -12,24 +12,14 @@
   v8_optimized_debug = true
 }
 
-check_targets = [
-  ":pdfium",
-  ":pdfium_embeddertests",
-  ":pdfium_unittests",
-  "//constants/*",
-  "//core/*",
-  "//fpdfsdk/*",
-  "//fxbarcode/*",
-  "//fxjs/*",
-  "//samples/*",
-  "//skia/*",
-  "//testing/:*",
-  "//testing/fuzzers/*",
-  "//testing/image_diff/*",
-  "//third_party:bigint",
-  "//third_party:fx_agg",
-  "//third_party:fx_freetype",
-  "//third_party:pdfium_base",
-  "//third_party:skia_shared",
-  "//xfa/*",
+no_check_targets = [
+  "//third_party/icu/*",
+  "//v8/src/inspector:*",
+  "//v8/test/cctest:*",
+  "//v8/test/unittests:*",
+  "//v8/test/wasm-api-tests:*",
+  "//v8/third_party/inspector_protocol:*",
+  "//v8/tools/debug_helper:*",
+  "//v8/tools/v8windbg:*",
+  "//v8:*",
 ]
diff --git a/BUILD.gn b/BUILD.gn
index e3ca0a1..c2d415d 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -347,6 +347,7 @@
   sources = [ "testing/image_diff/image_diff.cpp" ]
   deps = [
     "core/fxcrt",
+    "testing:path_service",
     "testing/image_diff",
     "//build/win:default_exe_manifest",
   ]
diff --git a/core/fxcrt/BUILD.gn b/core/fxcrt/BUILD.gn
index 128c7a5..5cd0d3a 100644
--- a/core/fxcrt/BUILD.gn
+++ b/core/fxcrt/BUILD.gn
@@ -99,6 +99,7 @@
     "../../testing/fuzzers/*",
     "../../third_party:fx_agg",
     "../../third_party:fx_lcms2",
+    "../../third_party:fx_libopenjpeg",
     "../../third_party:fx_tiff",
     "../../third_party:pdfium_base",
     "../../xfa/*",
diff --git a/testing/BUILD.gn b/testing/BUILD.gn
index 12c5114..f448f45 100644
--- a/testing/BUILD.gn
+++ b/testing/BUILD.gn
@@ -23,10 +23,9 @@
     "utils/file_util.h",
     "utils/hash.cpp",
     "utils/hash.h",
-    "utils/path_service.cpp",
-    "utils/path_service.h",
   ]
   data = [ "resources/" ]
+  public_deps = [ ":path_service" ]
   deps = [
     "../:pdfium_public_headers",
     "../core/fdrm",
@@ -49,6 +48,17 @@
   }
 }
 
+source_set("path_service") {
+  testonly = true
+  sources = [
+    "utils/path_service.cpp",
+    "utils/path_service.h",
+  ]
+  deps = [ "../core/fxcrt" ]
+  configs += [ "../:pdfium_core_config" ]
+  visibility = [ "../*" ]
+}
+
 source_set("test_environments") {
   testonly = true
   sources = [
diff --git a/third_party/BUILD.gn b/third_party/BUILD.gn
index 468f771..79829ad 100644
--- a/third_party/BUILD.gn
+++ b/third_party/BUILD.gn
@@ -412,6 +412,7 @@
     "libopenjpeg20/tgt.c",
     "libopenjpeg20/thread.c",
   ]
+  deps = [ "../core/fxcrt" ]
 }
 
 config("system_libpng_config") {