Fix build with gtk and pangocairo disabled

This was regressed by https://chromium-review.googlesource.com/c/chromium/src/+/2780505

Bug: 1189902
Change-Id: I2c318ce96caeebc5c1f21b15edfc17d73e3831d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2794815
Reviewed-by: Thomas Anderson <[email protected]>
Reviewed-by: Robert Liao <[email protected]>
Reviewed-by: Peter Kvitek <[email protected]>
Commit-Queue: Andrey Kosyakov <[email protected]>
Cr-Commit-Position: refs/heads/master@{#867709}
diff --git a/BUILD.gn b/BUILD.gn
index cfcb80d4..ee5a0a3 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -36,6 +36,10 @@
   import("//build/config/android/config.gni")
 }
 
+if (is_linux) {
+  import("build/config/linux/gtk/gtk.gni")
+}
+
 declare_args() {
   # A list of extra dependencies to add to the root target. This allows a
   # checkout to add additional targets without explicitly changing any checked-
@@ -758,7 +762,7 @@
     }
   }
 
-  if (is_linux && !is_chromecast) {
+  if (is_linux && !is_chromecast && use_gtk) {
     deps += [ "//ui/gtk:gtk_unittests" ]
   }