media/cast: Get cast_unittests building on Android

1. Re-sync'ed GYP and GN build files, consolidating duplicated items to
appear once in common targets.  Aside from aesthetics, this resolved
some link issues for Android.

2. Factored the cast testing tools into a separate GYPI to make it clear
they were being built for the desktop platforms only, and to make things
more manageable for the future.

3. Tweaks to enable generation of cast_unittests_apk and its successful
run on Android.

Testing notes: Generated build files using both GYP and GN, built and
ran cast_unittests on Linux, and built and ran cast_unittests_apk on
Android x86.  Also, trybot runs in one patch set have sanity-checked the
same on other platforms/architectures.

BUG=558714

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

Cr-Commit-Position: refs/heads/master@{#361783}
diff --git a/BUILD.gn b/BUILD.gn
index f7c2c63..3aeba3c 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -171,6 +171,7 @@
       "//ipc:ipc_tests",
       "//ipc/mojo:ipc_mojo_unittests",
       "//media:media_unittests",
+      "//media/cast:cast_unittests",
       "//media/midi:midi_unittests",
       "//mojo",
       "//mojo/application/public/cpp",
@@ -417,8 +418,6 @@
       "//gpu:gpu_perftests",
       "//ipc:ipc_perftests",
       "//media:media_perftests",
-      "//media/cast:generate_barcode_video",
-      "//media/cast:generate_timecode_audio",
       "//net:crash_cache",
       "//net:crl_set_dump",
       "//net:dns_fuzz_stub",
@@ -497,8 +496,8 @@
       # TODO(GYP): Remove this when the gles2 tests work
       "//gpu/command_buffer/client:gles2_implementation_no_check",
       "//gpu/khronos_glcts_support:khronos_glcts_test",  # TODO(GYP) crbug.com/471903 to make this complete.
-      "//media/cast:cast_benchmarks",
       "//media/cast:tap_proxy",
+      "//media/cast:testing_tools",
       "//mojo/application/public/cpp",
       "//skia:filter_fuzz_stub",
       "//skia:image_operations_bench",
@@ -580,14 +579,15 @@
       "//net:net_unittests",  # TODO(GYP)
     ]
   } else if (!is_android && !is_ios) {
-    deps += [
-      "//breakpad:symupload($host_toolchain)",
-      "//media/cast:cast_unittests",
-    ]
+    deps += [ "//breakpad:symupload($host_toolchain)" ]
   }
   if (is_chromecast) {
     deps += [ "//chromecast:cast_shell" ]
   }
+
+  if (is_ios || is_mac) {
+    deps += [ "//media/cast:cast_h264_vt_encoder_unittests" ]
+  }
 }
 
 group("gn_only") {