Add gn target for audio_device_tests.

Note (for myself) that this depends on https://codereview.webrtc.org/2219653004/ and https://codereview.webrtc.org/2214003002/, it should not be landed before them.

NOTRY=True
BUG=webrtc:6170,webrtc:5949

Review-Url: https://codereview.webrtc.org/2216423002
Cr-Commit-Position: refs/heads/master@{#13773}
diff --git a/.gn b/.gn
index 4cd7b01..75e2587 100644
--- a/.gn
+++ b/.gn
@@ -20,6 +20,7 @@
 # "gn check" or "gn gen --check".
 # TODO(kjellander): Keep adding paths to this list as work in webrtc:5589 is done.
 check_targets = [
+  "//webrtc/modules/audio_device/*",
   "//webrtc/voice_engine:level_indicator",
   "//webrtc/modules/audio_coding:isac_fix_test",
   "//webrtc/modules/audio_mixer:audio_conference_mixer",
diff --git a/webrtc/modules/audio_device/BUILD.gn b/webrtc/modules/audio_device/BUILD.gn
index 35a99ea..369d88a 100644
--- a/webrtc/modules/audio_device/BUILD.gn
+++ b/webrtc/modules/audio_device/BUILD.gn
@@ -29,6 +29,7 @@
     "../..:webrtc_common",
     "../../base:rtc_base",
     "../../base:rtc_base_approved",
+    "../../base:rtc_task_queue",
     "../../common_audio",
     "../../system_wrappers",
     "../utility",
@@ -210,3 +211,30 @@
     configs -= [ "//build/config/clang:find_bad_constructs" ]
   }
 }
+
+# These tests do not work on ios, see
+# https://bugs.chromium.org/p/webrtc/issues/detail?id=4755
+if (rtc_include_tests && !is_ios) {
+  executable("audio_device_tests") {
+    testonly = true
+    sources = [
+      "test/audio_device_test_api.cc",
+      "test/audio_device_test_defines.h",
+    ]
+    deps = [
+      ":audio_device",
+      "../..:webrtc_common",
+      "../../system_wrappers",
+      "../../test:test_support",
+      "../../test:test_support_main",
+      "../rtp_rtcp",
+      "../utility",
+      "//testing/gtest",
+    ]
+    configs += [ "../..:common_config" ]
+    public_configs = [
+      "../..:common_inherited_config",
+      ":audio_device_config",
+    ]
+  }
+}