Cleanup: Separate "UI" test utilities into a separate target.

Do not depend on this target from unit_tests.

BUG=159847

Review URL: https://codereview.chromium.org/1368403004

Cr-Commit-Position: refs/heads/master@{#352646}
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index dab46f1..348198d 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -1017,8 +1017,6 @@
     "notifications/notification_test_util.h",
     "password_manager/mock_password_store_service.cc",
     "password_manager/mock_password_store_service.h",
-    "password_manager/password_manager_test_base.cc",
-    "password_manager/password_manager_test_base.h",
     "password_manager/test_password_store_service.cc",
     "password_manager/test_password_store_service.h",
     "profile_resetter/profile_resetter_test_base.cc",
@@ -1045,8 +1043,6 @@
     "sync/profile_sync_components_factory_mock.h",
     "sync/profile_sync_service_mock.cc",
     "sync/profile_sync_service_mock.h",
-    "ui/webui/signin/login_ui_test_utils.cc",
-    "ui/webui/signin/login_ui_test_utils.h",
   ]
 
   configs += [ "//build/config:precompiled_headers" ]
@@ -1084,12 +1080,8 @@
 
   if (is_android) {
     sources -= [
-      "password_manager/password_manager_test_base.cc",
-      "password_manager/password_manager_test_base.h",
       "sessions/session_service_test_helper.cc",
       "sessions/session_service_test_helper.h",
-      "ui/webui/signin/login_ui_test_utils.cc",
-      "ui/webui/signin/login_ui_test_utils.h",
     ]
   }
 
@@ -1229,6 +1221,29 @@
   }
 }
 
+# In GYP this is part of test_support_ui.
+source_set("test_support_ui") {
+  testonly = true
+
+  # Always include this via the main test support UI target.
+  visibility = [ "//chrome/test:test_support_ui" ]
+
+  sources = [
+    "password_manager/password_manager_test_base.cc",
+    "password_manager/password_manager_test_base.h",
+    "ui/webui/signin/login_ui_test_utils.cc",
+    "ui/webui/signin/login_ui_test_utils.h",
+  ]
+
+  configs += [ "//build/config:precompiled_headers" ]
+
+  deps = [
+    "//components/metrics:test_support",
+    "//skia",
+    "//testing/gtest",
+  ]
+}
+
 if (enable_rlz_support) {
   source_set("rlz") {
     sources =