GN: Introduce templates.

Defines the rtc_executable, rtc_source_set, rtc_test and
rtc_static_library templates.

These templates provide no functionality yet, but will enable common
configuration to be introduced, avoiding repetition in every target

Changes summary:
- Prepend rtc_ to test, source_set, executable and static_library targets
- Change "configs -= [" to "suppressed_configs += ["
- Include webrtc/build/webrtc.gni where it wasn't included yet
- Delete import("//testing/test.gni"), since rtc_test makes it unnecessary.

BUG=webrtc:6187
TBR=henrik.lundin@webrtc.org,tommi@webrtc.org
NOTRY=True

Review-Url: https://codereview.webrtc.org/2301053002
Cr-Commit-Position: refs/heads/master@{#14043}
diff --git a/webrtc/BUILD.gn b/webrtc/BUILD.gn
index 9857423..eef896c 100644
--- a/webrtc/BUILD.gn
+++ b/webrtc/BUILD.gn
@@ -11,7 +11,6 @@
 import("//build/config/linux/pkg_config.gni")
 import("//build/config/sanitizers/sanitizers.gni")
 import("build/webrtc.gni")
-import("//testing/test.gni")
 import("//third_party/protobuf/proto_library.gni")
 
 # Contains the defines and includes in common.gypi that are duplicated both as
@@ -240,7 +239,7 @@
 }
 
 if (!is_ios || !build_with_chromium) {
-  source_set("webrtc") {
+  rtc_source_set("webrtc") {
     sources = [
       "call.h",
       "config.h",
@@ -287,7 +286,7 @@
 }
 
 if (!build_with_chromium) {
-  executable("webrtc_tests") {
+  rtc_executable("webrtc_tests") {
     testonly = true
     deps = [
       ":webrtc",
@@ -297,7 +296,7 @@
     ]
   }
 
-  executable("video_loopback") {
+  rtc_executable("video_loopback") {
     testonly = true
     sources = [
       "test/run_test.h",
@@ -323,12 +322,12 @@
     if (is_clang && !is_nacl) {
       # Suppress warnings from Chrome's Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 }
 
-source_set("webrtc_common") {
+rtc_source_set("webrtc_common") {
   sources = [
     "audio_sink.h",
     "common.cc",
@@ -347,7 +346,7 @@
   if (is_clang && !is_nacl) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 }
 
@@ -360,7 +359,7 @@
   }
 }
 
-source_set("rtc_event_log") {
+rtc_source_set("rtc_event_log") {
   sources = [
     "call/rtc_event_log.cc",
     "call/rtc_event_log.h",
@@ -384,12 +383,12 @@
   if (is_clang && !is_nacl) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 }
 
 if (rtc_enable_protobuf) {
-  source_set("rtc_event_log_parser") {
+  rtc_source_set("rtc_event_log_parser") {
     sources = [
       "call/rtc_event_log_parser.cc",
       "call/rtc_event_log_parser.h",
@@ -406,7 +405,7 @@
     if (is_clang && !is_nacl) {
       # Suppress warnings from Chrome's Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 }
@@ -436,7 +435,7 @@
     }
   }
 
-  test("rtc_unittests") {
+  rtc_test("rtc_unittests") {
     testonly = true
     sources = [
       "base/array_view_unittest.cc",
@@ -597,7 +596,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps = [
@@ -639,7 +638,7 @@
     }
   }
 
-  test("xmllite_xmpp_unittests") {
+  rtc_test("xmllite_xmpp_unittests") {
     configs += [
       ":common_config",
       ":rtc_unittests_config",
@@ -649,7 +648,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps = [
@@ -702,7 +701,7 @@
     }
   }
 
-  test("video_engine_tests") {
+  rtc_test("video_engine_tests") {
     testonly = true
     deps = [
       "audio:audio_tests",
@@ -715,7 +714,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
     if (is_android) {
       deps += [ "//testing/android/native_test:native_test_native_code" ]
@@ -728,7 +727,7 @@
     }
   }
 
-  source_set("video_quality_test") {
+  rtc_source_set("video_quality_test") {
     testonly = true
     configs += [ ":common_config" ]
     public_configs = [ ":common_inherited_config" ]
@@ -747,7 +746,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 
@@ -778,7 +777,7 @@
     }
   }
 
-  test("webrtc_perf_tests") {
+  rtc_test("webrtc_perf_tests") {
     testonly = true
     configs += [
       ":common_config",
@@ -787,7 +786,7 @@
     public_configs = [ ":common_inherited_config" ]
 
     if (!is_debug) {
-      configs -= [ "//build/config/compiler:default_optimization" ]
+      suppressed_configs += [ "//build/config/compiler:default_optimization" ]
       configs += [ "//build/config/compiler:optimize_max" ]
     }
 
@@ -828,11 +827,11 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 
-  test("webrtc_nonparallel_tests") {
+  rtc_test("webrtc_nonparallel_tests") {
     testonly = true
     configs += [
       ":common_config",
@@ -869,7 +868,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 }
diff --git a/webrtc/api/BUILD.gn b/webrtc/api/BUILD.gn
index d14fe1f..176df9e 100644
--- a/webrtc/api/BUILD.gn
+++ b/webrtc/api/BUILD.gn
@@ -7,7 +7,6 @@
 # be found in the AUTHORS file in the root of the source tree.
 
 import("../build/webrtc.gni")
-import("//testing/test.gni")
 if (is_android) {
   import("//build/config/android/config.gni")
   import("//build/config/android/rules.gni")
@@ -19,7 +18,7 @@
   ]
 }
 
-source_set("call_api") {
+rtc_source_set("call_api") {
   sources = [
     "call/audio_receive_stream.h",
     "call/audio_send_stream.h",
@@ -47,7 +46,7 @@
   }
 }
 
-source_set("libjingle_peerconnection") {
+rtc_source_set("libjingle_peerconnection") {
   cflags = []
   sources = [
     "audiotrack.cc",
@@ -128,7 +127,7 @@
 
   if (is_clang) {
     # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -167,7 +166,7 @@
     }
   }
 
-  source_set("libjingle_peerconnection_jni") {
+  rtc_source_set("libjingle_peerconnection_jni") {
     sources = [
       "android/jni/androidmediacodeccommon.h",
       "android/jni/androidmediadecoder_jni.cc",
@@ -199,7 +198,7 @@
 
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-      configs -= [
+      suppressed_configs += [
         "//build/config/clang:extra_warnings",
         "//build/config/clang:find_bad_constructs",
       ]
@@ -332,7 +331,7 @@
     }
   }
 
-  test("peerconnection_unittests") {
+  rtc_test("peerconnection_unittests") {
     testonly = true
     sources = [
       "datachannel_unittest.cc",
@@ -381,7 +380,7 @@
 
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     # TODO(jschuh): Bug 1348: fix this warning.
diff --git a/webrtc/audio/BUILD.gn b/webrtc/audio/BUILD.gn
index 762eb5f..ead25f8 100644
--- a/webrtc/audio/BUILD.gn
+++ b/webrtc/audio/BUILD.gn
@@ -8,7 +8,7 @@
 
 import("../build/webrtc.gni")
 
-source_set("audio") {
+rtc_source_set("audio") {
   sources = [
     "audio_receive_stream.cc",
     "audio_receive_stream.h",
@@ -26,7 +26,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -37,7 +37,7 @@
   ]
 }
 if (rtc_include_tests) {
-  source_set("audio_tests") {
+  rtc_source_set("audio_tests") {
     testonly = true
     sources = [
       "audio_receive_stream_unittest.cc",
@@ -52,7 +52,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 }
diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn
index 5da158a..075e4cc 100644
--- a/webrtc/base/BUILD.gn
+++ b/webrtc/base/BUILD.gn
@@ -90,7 +90,7 @@
 }
 
 # The subset of rtc_base approved for use outside of libjingle.
-static_library("rtc_base_approved") {
+rtc_static_library("rtc_base_approved") {
   defines = []
   libs = []
   deps = []
@@ -198,7 +198,7 @@
   defines = [ "WEBRTC_BUILD_LIBEVENT" ]
 }
 
-static_library("rtc_task_queue") {
+rtc_static_library("rtc_task_queue") {
   public_deps = [
     ":rtc_base_approved",
   ]
@@ -258,7 +258,7 @@
   }
 }
 
-static_library("rtc_base") {
+rtc_static_library("rtc_base") {
   cflags = []
   cflags_cc = []
   libs = []
@@ -428,7 +428,7 @@
 
   # TODO(henrike): issue 3307, make rtc_base build with the Chromium default
   # compiler settings.
-  configs -= [ "//build/config/compiler:chromium_code" ]
+  suppressed_configs += [ "//build/config/compiler:chromium_code" ]
   configs += [ "//build/config/compiler:no_chromium_code" ]
   if (!is_win) {
     cflags += [ "-Wno-uninitialized" ]
@@ -681,11 +681,11 @@
   }
   if (is_win && is_clang) {
     # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 }
 
-source_set("gtest_prod") {
+rtc_source_set("gtest_prod") {
   sources = [
     "gtest_prod_util.h",
   ]
@@ -706,7 +706,7 @@
     }
   }
 
-  source_set("rtc_base_tests_utils") {
+  rtc_source_set("rtc_base_tests_utils") {
     testonly = true
     sources = [
       # Also use this as a convenient dumping ground for misc files that are
@@ -743,7 +743,7 @@
 
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 }
diff --git a/webrtc/build/webrtc.gni b/webrtc/build/webrtc.gni
index 25d7258..49a3bc7 100644
--- a/webrtc/build/webrtc.gni
+++ b/webrtc/build/webrtc.gni
@@ -10,6 +10,7 @@
 import("//build/config/features.gni")
 import("//build/config/mips.gni")
 import("//build_overrides/webrtc.gni")
+import("//testing/test.gni")
 
 declare_args() {
   # Disable this to avoid building the Opus audio codec.
@@ -148,3 +149,97 @@
 rtc_libvpx_dir = "//third_party/libvpx"
 rtc_libyuv_dir = "//third_party/libyuv"
 rtc_opus_dir = "//third_party/opus"
+
+###############################################################################
+# Templates
+#
+
+# Points to //webrtc/ in webrtc stand-alone or to //third_party/webrtc/ in
+# chromium.
+# We need absolute paths for all configs in templates as they are shared in
+# different subdirectories.
+webrtc_root = get_path_info("../", "abspath")
+
+# Common configs to remove or add in all rtc targets.
+rtc_remove_configs = []
+rtc_add_configs = []
+
+set_defaults("rtc_test") {
+  configs = []
+  suppressed_configs = []
+}
+
+set_defaults("rtc_source_set") {
+  configs = []
+  suppressed_configs = []
+}
+
+set_defaults("rtc_executable") {
+  configs = []
+  suppressed_configs = []
+}
+
+set_defaults("rtc_static_library") {
+  configs = []
+  suppressed_configs = []
+}
+
+template("rtc_test") {
+  test(target_name) {
+    forward_variables_from(invoker,
+                           "*",
+                           [
+                             "configs",
+                             "suppressed_configs",
+                           ])
+    configs += invoker.configs
+    configs += rtc_add_configs
+    configs -= rtc_remove_configs
+    configs -= invoker.suppressed_configs
+  }
+}
+
+template("rtc_source_set") {
+  source_set(target_name) {
+    forward_variables_from(invoker,
+                           "*",
+                           [
+                             "configs",
+                             "suppressed_configs",
+                           ])
+    configs += invoker.configs
+    configs += rtc_add_configs
+    configs -= rtc_remove_configs
+    configs -= invoker.suppressed_configs
+  }
+}
+
+template("rtc_executable") {
+  executable(target_name) {
+    forward_variables_from(invoker,
+                           "*",
+                           [
+                             "configs",
+                             "suppressed_configs",
+                           ])
+    configs += invoker.configs
+    configs += rtc_add_configs
+    configs -= rtc_remove_configs
+    configs -= invoker.suppressed_configs
+  }
+}
+
+template("rtc_static_library") {
+  static_library(target_name) {
+    forward_variables_from(invoker,
+                           "*",
+                           [
+                             "configs",
+                             "suppressed_configs",
+                           ])
+    configs += invoker.configs
+    configs += rtc_add_configs
+    configs -= rtc_remove_configs
+    configs -= invoker.suppressed_configs
+  }
+}
diff --git a/webrtc/call/BUILD.gn b/webrtc/call/BUILD.gn
index eed2b07..ee708c5 100644
--- a/webrtc/call/BUILD.gn
+++ b/webrtc/call/BUILD.gn
@@ -8,7 +8,7 @@
 
 import("../build/webrtc.gni")
 
-source_set("call") {
+rtc_source_set("call") {
   sources = [
     "bitrate_allocator.cc",
     "call.cc",
@@ -22,7 +22,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -39,7 +39,7 @@
 }
 
 if (rtc_include_tests) {
-  source_set("call_tests") {
+  rtc_source_set("call_tests") {
     testonly = true
     sources = [
       "bitrate_allocator_unittest.cc",
@@ -57,7 +57,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 }
diff --git a/webrtc/common_audio/BUILD.gn b/webrtc/common_audio/BUILD.gn
index cc5a770..35f715a 100644
--- a/webrtc/common_audio/BUILD.gn
+++ b/webrtc/common_audio/BUILD.gn
@@ -8,7 +8,6 @@
 
 import("//build/config/arm.gni")
 import("../build/webrtc.gni")
-import("//testing/test.gni")
 
 config("common_audio_config") {
   include_dirs = [
@@ -18,7 +17,7 @@
   ]
 }
 
-source_set("common_audio") {
+rtc_source_set("common_audio") {
   sources = [
     "audio_converter.cc",
     "audio_converter.h",
@@ -183,7 +182,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   if (current_cpu == "x86" || current_cpu == "x64") {
@@ -192,7 +191,7 @@
 }
 
 if (current_cpu == "x86" || current_cpu == "x64") {
-  source_set("common_audio_sse2") {
+  rtc_source_set("common_audio_sse2") {
     sources = [
       "fir_filter_sse.cc",
       "resampler/sinc_resampler_sse.cc",
@@ -207,13 +206,13 @@
     if (is_clang) {
       # Suppress warnings from Chrome's Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 }
 
 if (rtc_build_with_neon) {
-  source_set("common_audio_neon") {
+  rtc_source_set("common_audio_neon") {
     sources = [
       "fir_filter_neon.cc",
       "resampler/sinc_resampler_neon.cc",
@@ -226,7 +225,7 @@
       # Enable compilation for the NEON instruction set. This is needed
       # since //build/config/arm.gni only enables NEON for iOS, not Android.
       # This provides the same functionality as webrtc/build/arm_neon.gypi.
-      configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
+      suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
       cflags = [ "-mfpu=neon" ]
     }
 
@@ -245,13 +244,13 @@
     if (is_clang) {
       # Suppress warnings from Chrome's Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 }
 
 if (rtc_include_tests) {
-  test("common_audio_unittests") {
+  rtc_test("common_audio_unittests") {
     testonly = true
 
     sources = [
@@ -298,7 +297,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps = [
diff --git a/webrtc/common_video/BUILD.gn b/webrtc/common_video/BUILD.gn
index ed5a738..cb1f024 100644
--- a/webrtc/common_video/BUILD.gn
+++ b/webrtc/common_video/BUILD.gn
@@ -7,7 +7,6 @@
 # be found in the AUTHORS file in the root of the source tree.
 
 import("../build/webrtc.gni")
-import("//testing/test.gni")
 
 config("common_video_config") {
   include_dirs = [
@@ -16,7 +15,7 @@
   ]
 }
 
-source_set("common_video") {
+rtc_source_set("common_video") {
   sources = [
     "bitrate_adjuster.cc",
     "h264/h264_common.cc",
@@ -53,7 +52,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -96,7 +95,7 @@
     }
   }
 
-  test("common_video_unittests") {
+  rtc_test("common_video_unittests") {
     testonly = true
 
     sources = [
@@ -118,7 +117,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps = [
diff --git a/webrtc/examples/BUILD.gn b/webrtc/examples/BUILD.gn
index b4d2bbe..6eb3f6f 100644
--- a/webrtc/examples/BUILD.gn
+++ b/webrtc/examples/BUILD.gn
@@ -6,6 +6,7 @@
 # in the file PATENTS.  All contributing project authors may
 # be found in the AUTHORS file in the root of the source tree.
 
+import("../build/webrtc.gni")
 if (is_android) {
   import("//build/config/android/config.gni")
   import("//build/config/android/rules.gni")
@@ -14,9 +15,6 @@
 } else if (is_ios) {
   import("//build/config/ios/rules.gni")
 }
-if (is_linux || is_win) {
-  import("//webrtc/build/webrtc.gni")
-}
 if (is_linux) {
   import("//build/config/linux/pkg_config.gni")
 }
@@ -136,7 +134,7 @@
     include_dirs = [ "objc/AppRTCDemo/common" ]
   }
 
-  source_set("apprtc_common") {
+  rtc_source_set("apprtc_common") {
     sources = [
       "objc/AppRTCDemo/common/ARDUtilities.h",
       "objc/AppRTCDemo/common/ARDUtilities.m",
@@ -173,7 +171,7 @@
     }
   }
 
-  source_set("apprtc_signaling") {
+  rtc_source_set("apprtc_signaling") {
     sources = [
       "objc/AppRTCDemo/ARDAppClient+Internal.h",
       "objc/AppRTCDemo/ARDAppClient.h",
@@ -293,7 +291,7 @@
   }
 
   if (is_mac) {
-    source_set("AppRTCDemo_app") {
+    rtc_source_set("AppRTCDemo_app") {
       sources = [
         "objc/AppRTCDemo/mac/APPRTCAppDelegate.h",
         "objc/AppRTCDemo/mac/APPRTCAppDelegate.m",
@@ -356,7 +354,7 @@
     }
   }
 
-  source_set("socketrocket") {
+  rtc_source_set("socketrocket") {
     sources = [
       "objc/AppRTCDemo/third_party/SocketRocket/SRWebSocket.h",
       "objc/AppRTCDemo/third_party/SocketRocket/SRWebSocket.m",
@@ -406,7 +404,7 @@
     }
   }
 
-  executable("peerconnection_client") {
+  rtc_executable("peerconnection_client") {
     sources = [
       "peerconnection/client/conductor.cc",
       "peerconnection/client/conductor.h",
@@ -418,7 +416,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
     if (is_win) {
       sources += [
@@ -456,7 +454,7 @@
       deps += [ "//third_party/jsoncpp" ]
     }
   }
-  executable("peerconnection_server") {
+  rtc_executable("peerconnection_server") {
     sources = [
       "peerconnection/server/data_socket.cc",
       "peerconnection/server/data_socket.h",
@@ -475,10 +473,10 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
-  executable("relayserver") {
+  rtc_executable("relayserver") {
     sources = [
       "relayserver/relayserver_main.cc",
     ]
@@ -492,10 +490,10 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
-  executable("turnserver") {
+  rtc_executable("turnserver") {
     sources = [
       "turnserver/turnserver_main.cc",
     ]
@@ -509,10 +507,10 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
-  executable("stunserver") {
+  rtc_executable("stunserver") {
     sources = [
       "stunserver/stunserver_main.cc",
     ]
@@ -526,7 +524,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 }
diff --git a/webrtc/libjingle/xmllite/BUILD.gn b/webrtc/libjingle/xmllite/BUILD.gn
index c35dde6..936e2b9 100644
--- a/webrtc/libjingle/xmllite/BUILD.gn
+++ b/webrtc/libjingle/xmllite/BUILD.gn
@@ -14,7 +14,7 @@
   ]
 }
 
-source_set("rtc_xmllite") {
+rtc_source_set("rtc_xmllite") {
   sources = [
     "qname.cc",
     "qname.h",
@@ -49,6 +49,6 @@
   if (!build_with_chromium && is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 }
diff --git a/webrtc/libjingle/xmpp/BUILD.gn b/webrtc/libjingle/xmpp/BUILD.gn
index 4c29fc0..87152ef 100644
--- a/webrtc/libjingle/xmpp/BUILD.gn
+++ b/webrtc/libjingle/xmpp/BUILD.gn
@@ -30,7 +30,7 @@
   ]
 }
 
-source_set("rtc_xmpp") {
+rtc_source_set("rtc_xmpp") {
   cflags = []
   sources = [
     "asyncsocket.h",
@@ -148,7 +148,7 @@
     if (is_clang) {
       # Suppress warnings from Chrome's Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 
diff --git a/webrtc/media/BUILD.gn b/webrtc/media/BUILD.gn
index df4e3d2..1a526a6 100644
--- a/webrtc/media/BUILD.gn
+++ b/webrtc/media/BUILD.gn
@@ -8,7 +8,6 @@
 
 import("//build/config/linux/pkg_config.gni")
 import("../build/webrtc.gni")
-import("//testing/test.gni")
 
 group("media") {
   deps = [
@@ -43,7 +42,7 @@
   }
 }
 
-source_set("rtc_media") {
+rtc_source_set("rtc_media") {
   defines = []
   libs = []
   deps = []
@@ -127,7 +126,7 @@
 
   if (is_clang) {
     # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-    configs -= [
+    suppressed_configs += [
       "//build/config/clang:extra_warnings",
       "//build/config/clang:find_bad_constructs",
     ]
@@ -227,7 +226,7 @@
     }
   }
 
-  source_set("rtc_unittest_main") {
+  rtc_source_set("rtc_unittest_main") {
     testonly = true
 
     include_dirs = []
@@ -268,7 +267,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps += [
@@ -320,7 +319,7 @@
     }
   }
 
-  test("rtc_media_unittests") {
+  rtc_test("rtc_media_unittests") {
     testonly = true
 
     defines = []
@@ -369,7 +368,7 @@
 
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-      configs -= [
+      suppressed_configs += [
         "//build/config/clang:extra_warnings",
         "//build/config/clang:find_bad_constructs",
       ]
diff --git a/webrtc/modules/BUILD.gn b/webrtc/modules/BUILD.gn
index 6c19b07..367c8ee 100644
--- a/webrtc/modules/BUILD.gn
+++ b/webrtc/modules/BUILD.gn
@@ -8,7 +8,6 @@
 
 import("../build/webrtc.gni")
 import("audio_coding/audio_coding.gni")
-import("//testing/test.gni")
 
 declare_args() {
   # Desktop capturer is supported only on Windows, OSX and Linux.
@@ -52,7 +51,7 @@
     }
   }
 
-  test("modules_tests") {
+  rtc_test("modules_tests") {
     testonly = true
 
     configs += [ "..:common_config" ]
@@ -113,7 +112,7 @@
 
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
     if (is_win) {
       cflags = [
@@ -240,7 +239,7 @@
     }
   }
 
-  test("modules_unittests") {
+  rtc_test("modules_unittests") {
     testonly = true
 
     defines = audio_coding_defines
@@ -574,7 +573,7 @@
 
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     if (is_win) {
diff --git a/webrtc/modules/audio_coding/BUILD.gn b/webrtc/modules/audio_coding/BUILD.gn
index 1dbc929..db97e24 100644
--- a/webrtc/modules/audio_coding/BUILD.gn
+++ b/webrtc/modules/audio_coding/BUILD.gn
@@ -9,7 +9,6 @@
 import("../../build/webrtc.gni")
 import("audio_coding.gni")
 import("//build/config/arm.gni")
-import("//testing/test.gni")
 import("//third_party/protobuf/proto_library.gni")
 
 audio_codec_deps = [
@@ -40,7 +39,7 @@
                       "../../system_wrappers",
                     ]
 
-source_set("audio_decoder_factory_interface") {
+rtc_source_set("audio_decoder_factory_interface") {
   sources = [
     "codecs/audio_decoder_factory.h",
     "codecs/audio_format.cc",
@@ -53,7 +52,7 @@
   ]
 }
 
-source_set("builtin_audio_decoder_factory") {
+rtc_source_set("builtin_audio_decoder_factory") {
   sources = [
     "codecs/builtin_audio_decoder_factory.cc",
     "codecs/builtin_audio_decoder_factory.h",
@@ -67,7 +66,7 @@
   defines = audio_codec_defines
 }
 
-source_set("rent_a_codec") {
+rtc_source_set("rent_a_codec") {
   sources = [
     "acm2/acm_codec_database.cc",
     "acm2/acm_codec_database.h",
@@ -87,7 +86,7 @@
   ]
 }
 
-source_set("audio_coding") {
+rtc_source_set("audio_coding") {
   sources = [
     "acm2/acm_common_defs.h",
     "acm2/acm_receiver.cc",
@@ -135,7 +134,7 @@
   defines = audio_coding_defines
 }
 
-source_set("audio_decoder_interface") {
+rtc_source_set("audio_decoder_interface") {
   sources = [
     "codecs/audio_decoder.cc",
     "codecs/audio_decoder.h",
@@ -148,7 +147,7 @@
   ]
 }
 
-source_set("audio_encoder_interface") {
+rtc_source_set("audio_encoder_interface") {
   sources = [
     "codecs/audio_encoder.cc",
     "codecs/audio_encoder.h",
@@ -168,7 +167,7 @@
   ]
 }
 
-source_set("cng") {
+rtc_source_set("cng") {
   sources = [
     "codecs/cng/audio_encoder_cng.cc",
     "codecs/cng/audio_encoder_cng.h",
@@ -193,7 +192,7 @@
   include_dirs = [ "codecs/red" ]
 }
 
-source_set("red") {
+rtc_source_set("red") {
   sources = [
     "codecs/red/audio_encoder_copy_red.cc",
     "codecs/red/audio_encoder_copy_red.h",
@@ -219,7 +218,7 @@
   ]
 }
 
-source_set("g711") {
+rtc_source_set("g711") {
   sources = [
     "codecs/g711/audio_decoder_pcm.cc",
     "codecs/g711/audio_decoder_pcm.h",
@@ -251,7 +250,7 @@
   ]
 }
 
-source_set("g722") {
+rtc_source_set("g722") {
   sources = [
     "codecs/g722/audio_decoder_g722.cc",
     "codecs/g722/audio_decoder_g722.h",
@@ -284,7 +283,7 @@
   ]
 }
 
-source_set("ilbc") {
+rtc_source_set("ilbc") {
   sources = [
     "codecs/ilbc/abs_quant.c",
     "codecs/ilbc/abs_quant.h",
@@ -446,7 +445,7 @@
   ]
 }
 
-source_set("isac_common") {
+rtc_source_set("isac_common") {
   sources = [
     "codecs/isac/audio_encoder_isac_t.h",
     "codecs/isac/audio_encoder_isac_t_impl.h",
@@ -463,7 +462,7 @@
   ]
 }
 
-source_set("isac") {
+rtc_source_set("isac") {
   sources = [
     "codecs/isac/main/include/audio_decoder_isac.h",
     "codecs/isac/main/include/audio_encoder_isac.h",
@@ -549,7 +548,7 @@
   ]
 }
 
-source_set("isac_fix") {
+rtc_source_set("isac_fix") {
   sources = [
     "codecs/isac/fix/include/audio_decoder_isacfix.h",
     "codecs/isac/fix/include/audio_encoder_isacfix.h",
@@ -661,7 +660,7 @@
 }
 
 if (rtc_build_with_neon) {
-  source_set("isac_neon") {
+  rtc_source_set("isac_neon") {
     sources = [
       "codecs/isac/fix/source/entropy_coding_neon.c",
       "codecs/isac/fix/source/filterbanks_neon.c",
@@ -674,7 +673,7 @@
       # Enable compilation for the NEON instruction set. This is needed
       # since //build/config/arm.gni only enables NEON for iOS, not Android.
       # This provides the same functionality as webrtc/build/arm_neon.gypi.
-      configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
+      suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
       cflags = [ "-mfpu=neon" ]
     }
 
@@ -703,7 +702,7 @@
   ]
 }
 
-source_set("pcm16b") {
+rtc_source_set("pcm16b") {
   sources = [
     "codecs/pcm16b/audio_decoder_pcm16b.cc",
     "codecs/pcm16b/audio_decoder_pcm16b.h",
@@ -731,7 +730,7 @@
   include_dirs = [ "../../.." ]
 }
 
-source_set("webrtc_opus") {
+rtc_source_set("webrtc_opus") {
   sources = [
     "codecs/opus/audio_decoder_opus.cc",
     "codecs/opus/audio_decoder_opus.h",
@@ -768,7 +767,7 @@
   ]
 }
 
-source_set("neteq") {
+rtc_source_set("neteq") {
   sources = [
     "neteq/accelerate.cc",
     "neteq/accelerate.h",
@@ -888,7 +887,7 @@
 }
 
 if (rtc_include_tests) {
-  source_set("acm_receive_test") {
+  rtc_source_set("acm_receive_test") {
     testonly = true
     sources = [
       "acm2/acm_receive_test_oldapi.cc",
@@ -907,7 +906,7 @@
            ]
   }
 
-  source_set("acm_send_test") {
+  rtc_source_set("acm_send_test") {
     testonly = true
     sources = [
       "acm2/acm_send_test_oldapi.cc",
@@ -926,7 +925,7 @@
            ]
   }
 
-  executable("delay_test") {
+  rtc_executable("delay_test") {
     testonly = true
     sources = [
       "test/Channel.cc",
@@ -951,7 +950,7 @@
     ]
   }  # delay_test
 
-  executable("insert_packet_with_timing") {
+  rtc_executable("insert_packet_with_timing") {
     testonly = true
     sources = [
       "test/Channel.cc",
@@ -965,7 +964,7 @@
     if (is_clang) {
       # Suppress warnings from Chrome's Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps = [
@@ -996,7 +995,7 @@
     }
   }
 
-  test("audio_decoder_unittests") {
+  rtc_test("audio_decoder_unittests") {
     testonly = true
     sources = [
       "neteq/audio_decoder_unittest.cc",
@@ -1007,7 +1006,7 @@
 
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugins (bugs.webrtc.org/163).
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps = []
@@ -1044,7 +1043,7 @@
       proto_out_dir = "webrtc/audio_coding/neteq"
     }
 
-    source_set("rtc_event_log_source") {
+    rtc_source_set("rtc_event_log_source") {
       testonly = true
       sources = [
         "neteq/tools/rtc_event_log_source.cc",
@@ -1054,7 +1053,7 @@
       if (is_clang) {
         # Suppress warnings from the Chromium Clang plugins
         # (bugs.webrtc.org/163).
-        configs -= [ "//build/config/clang:find_bad_constructs" ]
+        suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
       }
 
       deps = [
@@ -1065,7 +1064,7 @@
       ]
     }
 
-    test("neteq_rtpplay") {
+    rtc_test("neteq_rtpplay") {
       testonly = true
       defines = []
       deps = []
@@ -1076,7 +1075,7 @@
       if (is_clang) {
         # Suppress warnings from the Chromium Clang plugins
         # (bugs.webrtc.org/163).
-        configs -= [ "//build/config/clang:find_bad_constructs" ]
+        suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
       }
 
       if (is_win) {
@@ -1096,7 +1095,7 @@
     }
   }
 
-  test("audio_codec_speed_tests") {
+  rtc_test("audio_codec_speed_tests") {
     testonly = true
     defines = []
     deps = []
@@ -1110,7 +1109,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugins
       # (bugs.webrtc.org/163).
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     if (is_android) {
@@ -1128,7 +1127,7 @@
     ]
   }
 
-  source_set("neteq_test_support") {
+  rtc_source_set("neteq_test_support") {
     testonly = true
     sources = [
       "neteq/tools/neteq_external_decoder_test.cc",
@@ -1141,13 +1140,13 @@
     public_configs = [ "../..:common_inherited_config" ]
 
     if (!is_debug) {
-      configs -= [ "//build/config/compiler:default_optimization" ]
+      suppressed_configs += [ "//build/config/compiler:default_optimization" ]
       configs += [ "//build/config/compiler:optimize_max" ]
     }
 
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugins (bugs.webrtc.org/163).
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps = [
@@ -1159,7 +1158,7 @@
     ]
   }
 
-  source_set("neteq_quality_test_support") {
+  rtc_source_set("neteq_quality_test_support") {
     testonly = true
     sources = [
       "neteq/tools/neteq_quality_test.cc",
@@ -1171,7 +1170,7 @@
 
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugins (bugs.webrtc.org/163).
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps = [
@@ -1186,7 +1185,7 @@
     include_dirs = [ "tools" ]
   }
 
-  source_set("neteq_unittest_tools") {
+  rtc_source_set("neteq_unittest_tools") {
     testonly = true
     sources = [
       "neteq/tools/audio_checksum.h",
@@ -1229,7 +1228,7 @@
 
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugins (bugs.webrtc.org/163).
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps = [
@@ -1243,7 +1242,7 @@
     }
   }
 
-  source_set("neteq_test_tools") {
+  rtc_source_set("neteq_test_tools") {
     testonly = true
     sources = [
       "neteq/test/NETEQTEST_DummyRTPpacket.cc",
@@ -1297,7 +1296,7 @@
     ]
   }
 
-  executable("RTPencode") {
+  rtc_executable("RTPencode") {
     testonly = true
 
     deps = [
@@ -1333,7 +1332,7 @@
     }
   }
 
-  executable("RTPchange") {
+  rtc_executable("RTPchange") {
     testonly = true
 
     sources = [
@@ -1346,7 +1345,7 @@
     ]
   }
 
-  executable("rtpcat") {
+  rtc_executable("rtpcat") {
     testonly = true
 
     sources = [
@@ -1361,7 +1360,7 @@
     ]
   }
 
-  executable("RTPtimeshift") {
+  rtc_executable("RTPtimeshift") {
     testonly = true
 
     sources = [
@@ -1375,7 +1374,7 @@
     ]
   }
 
-  executable("RTPjitter") {
+  rtc_executable("RTPjitter") {
     testonly = true
     deps = [
       "../..:webrtc_common",
@@ -1387,7 +1386,7 @@
     ]
   }
 
-  executable("rtp_analyze") {
+  rtc_executable("rtp_analyze") {
     testonly = true
 
     sources = [
@@ -1407,11 +1406,11 @@
     if (is_clang) {
       # Suppress warnings from Chrome's Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 
-  executable("neteq_opus_quality_test") {
+  rtc_executable("neteq_opus_quality_test") {
     testonly = true
 
     sources = [
@@ -1430,7 +1429,7 @@
     ]
   }
 
-  executable("neteq_speed_test") {
+  rtc_executable("neteq_speed_test") {
     testonly = true
 
     sources = [
@@ -1447,7 +1446,7 @@
     ]
   }
 
-  executable("audio_classifier_test") {
+  rtc_executable("audio_classifier_test") {
     testonly = true
     sources = [
       "neteq/test/audio_classifier_test.cc",
@@ -1460,7 +1459,7 @@
     ]
   }
 
-  executable("neteq_ilbc_quality_test") {
+  rtc_executable("neteq_ilbc_quality_test") {
     testonly = true
 
     sources = [
@@ -1480,7 +1479,7 @@
     ]
   }
 
-  executable("neteq_isac_quality_test") {
+  rtc_executable("neteq_isac_quality_test") {
     testonly = true
 
     sources = [
@@ -1498,7 +1497,7 @@
     ]
   }
 
-  executable("neteq_pcmu_quality_test") {
+  rtc_executable("neteq_pcmu_quality_test") {
     testonly = true
 
     sources = [
@@ -1516,7 +1515,7 @@
     ]
   }
 
-  executable("isac_fix_test") {
+  rtc_executable("isac_fix_test") {
     testonly = true
 
     sources = [
@@ -1547,7 +1546,7 @@
     }
   }
 
-  executable("isac_test") {
+  rtc_executable("isac_test") {
     testonly = true
 
     sources = [
@@ -1570,7 +1569,7 @@
     configs += [ ":isac_test_warnings_config" ]
   }
 
-  executable("g711_test") {
+  rtc_executable("g711_test") {
     testonly = true
 
     sources = [
@@ -1586,7 +1585,7 @@
     ]
   }
 
-  executable("g722_test") {
+  rtc_executable("g722_test") {
     testonly = true
 
     sources = [
@@ -1603,7 +1602,7 @@
     ]
   }
 
-  executable("isac_api_test") {
+  rtc_executable("isac_api_test") {
     testonly = true
 
     sources = [
@@ -1627,7 +1626,7 @@
     ]
   }
 
-  executable("isac_switch_samprate_test") {
+  rtc_executable("isac_switch_samprate_test") {
     testonly = true
 
     sources = [
@@ -1651,7 +1650,7 @@
     ]
   }
 
-  executable("ilbc_test") {
+  rtc_executable("ilbc_test") {
     testonly = true
 
     sources = [
@@ -1667,7 +1666,7 @@
     ]
   }
 
-  executable("webrtc_opus_fec_test") {
+  rtc_executable("webrtc_opus_fec_test") {
     testonly = true
 
     sources = [
@@ -1687,7 +1686,7 @@
     if (is_clang) {
       # Suppress warnings from Chrome's Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 }
diff --git a/webrtc/modules/audio_conference_mixer/BUILD.gn b/webrtc/modules/audio_conference_mixer/BUILD.gn
index 36391c7..72379fa 100644
--- a/webrtc/modules/audio_conference_mixer/BUILD.gn
+++ b/webrtc/modules/audio_conference_mixer/BUILD.gn
@@ -6,6 +6,8 @@
 # in the file PATENTS.  All contributing project authors may
 # be found in the AUTHORS file in the root of the source tree.
 
+import("../../build/webrtc.gni")
+
 config("audio_conference_mixer_config") {
   visibility = [ ":*" ]  # Only targets in this file can depend on this.
   include_dirs = [
@@ -14,7 +16,7 @@
   ]
 }
 
-source_set("audio_conference_mixer") {
+rtc_source_set("audio_conference_mixer") {
   sources = [
     "include/audio_conference_mixer.h",
     "include/audio_conference_mixer_defines.h",
@@ -39,7 +41,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
diff --git a/webrtc/modules/audio_device/BUILD.gn b/webrtc/modules/audio_device/BUILD.gn
index a8867af..6e82045 100644
--- a/webrtc/modules/audio_device/BUILD.gn
+++ b/webrtc/modules/audio_device/BUILD.gn
@@ -48,7 +48,7 @@
   }
 }
 
-source_set("audio_device") {
+rtc_source_set("audio_device") {
   configs += [ "../..:common_config" ]
   public_configs = [
     "../..:common_inherited_config",
@@ -240,14 +240,14 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_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") {
+  rtc_executable("audio_device_tests") {
     testonly = true
     sources = [
       "test/audio_device_test_api.cc",
diff --git a/webrtc/modules/audio_mixer/BUILD.gn b/webrtc/modules/audio_mixer/BUILD.gn
index 3dd5e01..51fd785 100644
--- a/webrtc/modules/audio_mixer/BUILD.gn
+++ b/webrtc/modules/audio_mixer/BUILD.gn
@@ -6,11 +6,13 @@
 # in the file PATENTS.  All contributing project authors may
 # be found in the AUTHORS file in the root of the source tree.
 
+import("../../build/webrtc.gni")
+
 config("audio_conference_mixer_config") {
   include_dirs = [ "../../modules/include" ]
 }
 
-source_set("audio_mixer") {
+rtc_source_set("audio_mixer") {
   sources = [
     "audio_frame_manipulator.cc",
     "audio_frame_manipulator.h",
@@ -35,7 +37,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
diff --git a/webrtc/modules/audio_processing/BUILD.gn b/webrtc/modules/audio_processing/BUILD.gn
index fcbb44a..66a7c2b 100644
--- a/webrtc/modules/audio_processing/BUILD.gn
+++ b/webrtc/modules/audio_processing/BUILD.gn
@@ -17,7 +17,7 @@
   aec_untrusted_delay_for_testing = false
 }
 
-source_set("audio_processing") {
+rtc_source_set("audio_processing") {
   sources = [
     "aec/aec_core.cc",
     "aec/aec_core.h",
@@ -254,7 +254,7 @@
 }
 
 if (current_cpu == "x86" || current_cpu == "x64") {
-  source_set("audio_processing_sse2") {
+  rtc_source_set("audio_processing_sse2") {
     sources = [
       "aec/aec_core_sse2.cc",
       "aec/aec_rdft_sse2.cc",
@@ -276,7 +276,7 @@
 }
 
 if (rtc_build_with_neon) {
-  source_set("audio_processing_neon") {
+  rtc_source_set("audio_processing_neon") {
     sources = [
       "aec/aec_core_neon.cc",
       "aec/aec_rdft_neon.cc",
@@ -288,7 +288,7 @@
       # Enable compilation for the NEON instruction set. This is needed
       # since //build/config/arm.gni only enables NEON for iOS, not Android.
       # This provides the same functionality as webrtc/build/arm_neon.gypi.
-      configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
+      suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
       cflags = [ "-mfpu=neon" ]
     }
 
@@ -317,7 +317,7 @@
 }
 
 if (rtc_include_tests) {
-  executable("audioproc") {
+  rtc_executable("audioproc") {
     testonly = true
     sources = [
       "test/process_test.cc",
@@ -340,7 +340,7 @@
     ]
   }  # audioproc
 
-  executable("unpack_aecdump") {
+  rtc_executable("unpack_aecdump") {
     testonly = true
     sources = [
       "test/unpack.cc",
@@ -361,7 +361,7 @@
     ]
   }  # unpack_aecdump
 
-  executable("audioproc_f") {
+  rtc_executable("audioproc_f") {
     testonly = true
     sources = [
       "test/aec_dump_based_simulator.cc",
@@ -390,7 +390,7 @@
     ]
   }  # audioproc_f
 
-  source_set("audioproc_test_utils") {
+  rtc_source_set("audioproc_test_utils") {
     testonly = true
     sources = [
       "test/audio_buffer_tools.cc",
@@ -408,7 +408,7 @@
     ]
   }
 
-  executable("transient_suppression_test") {
+  rtc_executable("transient_suppression_test") {
     testonly = true
     sources = [
       "transient/file_utils.cc",
@@ -424,7 +424,7 @@
     ]
   }
 
-  executable("click_annotate") {
+  rtc_executable("click_annotate") {
     testonly = true
     sources = [
       "transient/click_annotate.cc",
@@ -437,7 +437,7 @@
     ]
   }
 
-  executable("nonlinear_beamformer_test") {
+  rtc_executable("nonlinear_beamformer_test") {
     testonly = true
     sources = [
       "beamformer/nonlinear_beamformer_test.cc",
@@ -451,7 +451,7 @@
   }
 
   if (rtc_enable_intelligibility_enhancer) {
-    executable("intelligibility_proc") {
+    rtc_executable("intelligibility_proc") {
       testonly = true
       sources = [
         "intelligibility/test/intelligibility_proc.cc",
@@ -475,7 +475,7 @@
       proto_out_dir = "webrtc/modules/audio_processing"
     }
 
-    source_set("audioproc_protobuf_utils") {
+    rtc_source_set("audioproc_protobuf_utils") {
       sources = [
         "test/protobuf_utils.cc",
         "test/protobuf_utils.h",
diff --git a/webrtc/modules/bitrate_controller/BUILD.gn b/webrtc/modules/bitrate_controller/BUILD.gn
index 029f541..2d5e982 100644
--- a/webrtc/modules/bitrate_controller/BUILD.gn
+++ b/webrtc/modules/bitrate_controller/BUILD.gn
@@ -8,7 +8,7 @@
 
 import("../../build/webrtc.gni")
 
-source_set("bitrate_controller") {
+rtc_source_set("bitrate_controller") {
   sources = [
     "bitrate_controller_impl.cc",
     "bitrate_controller_impl.h",
@@ -27,7 +27,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
diff --git a/webrtc/modules/congestion_controller/BUILD.gn b/webrtc/modules/congestion_controller/BUILD.gn
index add1a4d..c8d6847 100644
--- a/webrtc/modules/congestion_controller/BUILD.gn
+++ b/webrtc/modules/congestion_controller/BUILD.gn
@@ -8,7 +8,7 @@
 
 import("../../build/webrtc.gni")
 
-source_set("congestion_controller") {
+rtc_source_set("congestion_controller") {
   sources = [
     "congestion_controller.cc",
     "delay_based_bwe.cc",
@@ -27,7 +27,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
diff --git a/webrtc/modules/desktop_capture/BUILD.gn b/webrtc/modules/desktop_capture/BUILD.gn
index 61a3de2..8e3f36d 100644
--- a/webrtc/modules/desktop_capture/BUILD.gn
+++ b/webrtc/modules/desktop_capture/BUILD.gn
@@ -12,7 +12,7 @@
 use_desktop_capture_differ_sse2 =
     !is_ios && (current_cpu == "x86" || current_cpu == "x64")
 
-source_set("primitives") {
+rtc_source_set("primitives") {
   sources = [
     "desktop_capture_types.h",
     "desktop_frame.cc",
@@ -26,7 +26,7 @@
   public_configs = [ "../..:common_inherited_config" ]
 }
 
-source_set("desktop_capture") {
+rtc_source_set("desktop_capture") {
   sources = [
     "cropped_desktop_frame.cc",
     "cropped_desktop_frame.h",
@@ -154,7 +154,7 @@
   if (is_clang && !is_nacl) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -171,7 +171,7 @@
 if (use_desktop_capture_differ_sse2) {
   # Have to be compiled as a separate target because it needs to be compiled
   # with SSE2 enabled.
-  source_set("desktop_capture_differ_sse2") {
+  rtc_source_set("desktop_capture_differ_sse2") {
     visibility = [ ":*" ]
     sources = [
       "differ_block_sse2.cc",
diff --git a/webrtc/modules/media_file/BUILD.gn b/webrtc/modules/media_file/BUILD.gn
index 84f094f..c4d5424 100644
--- a/webrtc/modules/media_file/BUILD.gn
+++ b/webrtc/modules/media_file/BUILD.gn
@@ -12,7 +12,7 @@
   visibility = [ ":*" ]  # Only targets in this file can depend on this.
 }
 
-source_set("media_file") {
+rtc_source_set("media_file") {
   sources = [
     "media_file.h",
     "media_file_defines.h",
@@ -34,7 +34,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
diff --git a/webrtc/modules/pacing/BUILD.gn b/webrtc/modules/pacing/BUILD.gn
index 0354c64..0cf8e6e 100644
--- a/webrtc/modules/pacing/BUILD.gn
+++ b/webrtc/modules/pacing/BUILD.gn
@@ -6,7 +6,9 @@
 # in the file PATENTS.  All contributing project authors may
 # be found in the AUTHORS file in the root of the source tree.
 
-source_set("pacing") {
+import("../../build/webrtc.gni")
+
+rtc_source_set("pacing") {
   sources = [
     "bitrate_prober.cc",
     "bitrate_prober.h",
@@ -22,7 +24,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
diff --git a/webrtc/modules/remote_bitrate_estimator/BUILD.gn b/webrtc/modules/remote_bitrate_estimator/BUILD.gn
index bbf74ab..ea4f38e 100644
--- a/webrtc/modules/remote_bitrate_estimator/BUILD.gn
+++ b/webrtc/modules/remote_bitrate_estimator/BUILD.gn
@@ -7,14 +7,13 @@
 # be found in the AUTHORS file in the root of the source tree.
 
 import("../../build/webrtc.gni")
-import("//testing/test.gni")
 
 declare_args() {
   # Set this to true to enable BWE test logging.
   rtc_enable_bwe_test_logging = false
 }
 
-source_set("remote_bitrate_estimator") {
+rtc_source_set("remote_bitrate_estimator") {
   sources = [
     "aimd_rate_control.cc",
     "aimd_rate_control.h",
@@ -52,7 +51,7 @@
 
   if (is_clang) {
     # Suppress warnings from the Chromium Clang plugins (bugs.webrtc.org/163).
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -63,7 +62,7 @@
 }
 
 if (rtc_include_tests) {
-  source_set("bwe_simulator") {
+  rtc_source_set("bwe_simulator") {
     testonly = true
     sources = [
       "test/bwe.cc",
@@ -106,7 +105,7 @@
 
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugins (bugs.webrtc.org/163).
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     if (is_win) {
diff --git a/webrtc/modules/rtp_rtcp/BUILD.gn b/webrtc/modules/rtp_rtcp/BUILD.gn
index fb270b3..ff55791 100644
--- a/webrtc/modules/rtp_rtcp/BUILD.gn
+++ b/webrtc/modules/rtp_rtcp/BUILD.gn
@@ -8,7 +8,7 @@
 
 import("../../build/webrtc.gni")
 
-source_set("rtp_rtcp") {
+rtc_source_set("rtp_rtcp") {
   sources = [
     "include/fec_receiver.h",
     "include/receive_statistics.h",
@@ -160,7 +160,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -182,7 +182,7 @@
 }
 
 if (rtc_include_tests) {
-  executable("test_packet_masks_metrics") {
+  rtc_executable("test_packet_masks_metrics") {
     testonly = true
 
     sources = [
diff --git a/webrtc/modules/utility/BUILD.gn b/webrtc/modules/utility/BUILD.gn
index b1ae692..7647d38 100644
--- a/webrtc/modules/utility/BUILD.gn
+++ b/webrtc/modules/utility/BUILD.gn
@@ -8,7 +8,7 @@
 
 import("../../build/webrtc.gni")
 
-source_set("utility") {
+rtc_source_set("utility") {
   sources = [
     "include/audio_frame_operations.h",
     "include/file_player.h",
@@ -34,7 +34,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   if (is_ios) {
diff --git a/webrtc/modules/video_capture/BUILD.gn b/webrtc/modules/video_capture/BUILD.gn
index 0875ed8..23b978b 100644
--- a/webrtc/modules/video_capture/BUILD.gn
+++ b/webrtc/modules/video_capture/BUILD.gn
@@ -7,13 +7,12 @@
 # be found in the AUTHORS file in the root of the source tree.
 
 import("../../build/webrtc.gni")
-import("//testing/test.gni")
 
 # Note this target is missing an implementation for the video capture.
 # Targets must link with either 'video_capture' or
 # 'video_capture_internal_impl' depending on whether they want to
 # use the internal capturer.
-source_set("video_capture_module") {
+rtc_source_set("video_capture_module") {
   sources = [
     "device_info_impl.cc",
     "device_info_impl.h",
@@ -40,11 +39,11 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 }
 
-source_set("video_capture") {
+rtc_source_set("video_capture") {
   sources = [
     "external/device_info_external.cc",
     "external/video_capture_external.cc",
@@ -61,7 +60,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 }
 
@@ -94,7 +93,7 @@
     }
   }
 
-  source_set("video_capture_internal_impl") {
+  rtc_source_set("video_capture_internal_impl") {
     configs += [ ":video_capture_internal_impl_warnings_config" ]
 
     deps = [
@@ -186,12 +185,12 @@
     if (is_clang) {
       # Suppress warnings from Chrome's Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 
   if (!is_android && rtc_include_tests) {
-    test("video_capture_tests") {
+    rtc_test("video_capture_tests") {
       sources = [
         "test/video_capture_main_mac.mm",
         "test/video_capture_unittest.cc",
@@ -234,7 +233,7 @@
       if (is_clang) {
         # Suppress warnings from Chrome's Clang plugins.
         # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-        configs -= [ "//build/config/clang:find_bad_constructs" ]
+        suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
       }
     }
   }
diff --git a/webrtc/modules/video_coding/BUILD.gn b/webrtc/modules/video_coding/BUILD.gn
index 8cd7570..8b40b7e 100644
--- a/webrtc/modules/video_coding/BUILD.gn
+++ b/webrtc/modules/video_coding/BUILD.gn
@@ -8,7 +8,7 @@
 
 import("../../build/webrtc.gni")
 
-source_set("video_coding") {
+rtc_source_set("video_coding") {
   sources = [
     "codec_database.cc",
     "codec_database.h",
@@ -83,7 +83,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -98,7 +98,7 @@
   ]
 }
 
-source_set("video_coding_utility") {
+rtc_source_set("video_coding_utility") {
   sources = [
     "utility/frame_dropper.cc",
     "utility/frame_dropper.h",
@@ -121,7 +121,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -130,7 +130,7 @@
   ]
 }
 
-source_set("webrtc_h264") {
+rtc_source_set("webrtc_h264") {
   sources = [
     "codecs/h264/h264.cc",
     "codecs/h264/include/h264.h",
@@ -142,7 +142,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   defines = []
@@ -175,7 +175,7 @@
 }
 
 if (is_ios) {
-  source_set("webrtc_h264_video_toolbox") {
+  rtc_source_set("webrtc_h264_video_toolbox") {
     sources = [
       "codecs/h264/h264_video_toolbox_decoder.cc",
       "codecs/h264/h264_video_toolbox_decoder.h",
@@ -204,7 +204,7 @@
     if (is_clang) {
       # Suppress warnings from Chrome's Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     if (rtc_build_libyuv) {
@@ -219,7 +219,7 @@
   }
 }
 
-source_set("webrtc_i420") {
+rtc_source_set("webrtc_i420") {
   sources = [
     "codecs/i420/i420.cc",
     "codecs/i420/include/i420.h",
@@ -231,7 +231,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -239,7 +239,7 @@
   ]
 }
 
-source_set("webrtc_vp8") {
+rtc_source_set("webrtc_vp8") {
   sources = [
     "codecs/vp8/default_temporal_layers.cc",
     "codecs/vp8/default_temporal_layers.h",
@@ -266,7 +266,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -280,7 +280,7 @@
   }
 }
 
-source_set("webrtc_vp9") {
+rtc_source_set("webrtc_vp9") {
   sources = [
     "codecs/vp9/include/vp9.h",
     "codecs/vp9/screenshare_layers.cc",
@@ -297,7 +297,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -311,7 +311,7 @@
 }
 
 if (rtc_include_tests) {
-  source_set("video_codecs_test_framework") {
+  rtc_source_set("video_codecs_test_framework") {
     testonly = true
     sources = [
       "codecs/test/mock/mock_packet_manipulator.h",
@@ -331,7 +331,7 @@
     if (is_clang) {
       # Suppress warnings from Chrome's Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps = [
diff --git a/webrtc/modules/video_processing/BUILD.gn b/webrtc/modules/video_processing/BUILD.gn
index 1177d9b..c297e29 100644
--- a/webrtc/modules/video_processing/BUILD.gn
+++ b/webrtc/modules/video_processing/BUILD.gn
@@ -11,7 +11,7 @@
 
 build_video_processing_sse2 = current_cpu == "x86" || current_cpu == "x64"
 
-source_set("video_processing") {
+rtc_source_set("video_processing") {
   sources = [
     "frame_preprocessor.cc",
     "frame_preprocessor.h",
@@ -54,12 +54,12 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 }
 
 if (build_video_processing_sse2) {
-  source_set("video_processing_sse2") {
+  rtc_source_set("video_processing_sse2") {
     sources = [
       "util/denoiser_filter_sse2.cc",
       "util/denoiser_filter_sse2.h",
@@ -71,7 +71,7 @@
     if (is_clang) {
       # Suppress warnings from Chrome's Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     if (is_posix) {
@@ -81,13 +81,13 @@
 }
 
 if (rtc_build_with_neon) {
-  source_set("video_processing_neon") {
+  rtc_source_set("video_processing_neon") {
     sources = [
       "util/denoiser_filter_neon.cc",
       "util/denoiser_filter_neon.h",
     ]
     if (current_cpu != "arm64") {
-      configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
+      suppressed_configs += [ "//build/config/compiler:compiler_arm_fpu" ]
       cflags = [ "-mfpu=neon" ]
     }
     configs += [ "../..:common_config" ]
diff --git a/webrtc/p2p/BUILD.gn b/webrtc/p2p/BUILD.gn
index 5f0f522..ac26779 100644
--- a/webrtc/p2p/BUILD.gn
+++ b/webrtc/p2p/BUILD.gn
@@ -18,7 +18,7 @@
   defines = [ "FEATURE_ENABLE_VOICEMAIL" ]
 }
 
-source_set("rtc_p2p") {
+rtc_source_set("rtc_p2p") {
   sources = [
     "base/asyncstuntcpsocket.cc",
     "base/asyncstuntcpsocket.h",
@@ -122,7 +122,7 @@
     if (is_clang) {
       # Suppress warnings from Chrome's Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 
@@ -146,7 +146,7 @@
   }
 }
 
-source_set("libstunprober") {
+rtc_source_set("libstunprober") {
   sources = [
     "stunprober/stunprober.cc",
   ]
@@ -154,7 +154,7 @@
   if (!build_with_chromium && is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -165,8 +165,7 @@
 
 if (!build_with_chromium) {
   # Doesn't build within Chrome on Win.
-
-  executable("stun_prober") {
+  rtc_executable("stun_prober") {
     sources = [
       "stunprober/main.cc",
     ]
@@ -175,7 +174,7 @@
     if (!build_with_chromium && is_clang) {
       # Suppress warnings from Chrome's Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps = [
diff --git a/webrtc/pc/BUILD.gn b/webrtc/pc/BUILD.gn
index 906d995..3b4611b 100644
--- a/webrtc/pc/BUILD.gn
+++ b/webrtc/pc/BUILD.gn
@@ -7,7 +7,6 @@
 # be found in the AUTHORS file in the root of the source tree.
 
 import("../build/webrtc.gni")
-import("//testing/test.gni")
 
 group("pc") {
   deps = [
@@ -23,7 +22,7 @@
   ]
 }
 
-source_set("rtc_pc") {
+rtc_source_set("rtc_pc") {
   defines = []
   sources = [
     "audiomonitor.cc",
@@ -72,7 +71,7 @@
 
   if (is_clang) {
     # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 }
 
@@ -86,7 +85,7 @@
     }
   }
 
-  test("rtc_pc_unittests") {
+  rtc_test("rtc_pc_unittests") {
     testonly = true
 
     sources = [
@@ -109,7 +108,7 @@
 
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     if (is_win) {
diff --git a/webrtc/sdk/BUILD.gn b/webrtc/sdk/BUILD.gn
index 0f63127..69ec091 100644
--- a/webrtc/sdk/BUILD.gn
+++ b/webrtc/sdk/BUILD.gn
@@ -18,7 +18,7 @@
     ]
   }
 
-  source_set("rtc_sdk_common_objc") {
+  rtc_source_set("rtc_sdk_common_objc") {
     deps = [
       "../base:rtc_base",
     ]
@@ -69,7 +69,7 @@
     }
   }
 
-  source_set("rtc_sdk_peerconnection_objc") {
+  rtc_source_set("rtc_sdk_peerconnection_objc") {
     sources = [
       "objc/Framework/Classes/RTCAVFoundationVideoSource+Private.h",
       "objc/Framework/Classes/RTCAVFoundationVideoSource.mm",
@@ -195,7 +195,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     libs += [ "AVFoundation.framework" ]
diff --git a/webrtc/stats/BUILD.gn b/webrtc/stats/BUILD.gn
index d1c08bd..e1f5ea1 100644
--- a/webrtc/stats/BUILD.gn
+++ b/webrtc/stats/BUILD.gn
@@ -7,7 +7,6 @@
 # be found in the AUTHORS file in the root of the source tree.
 
 import("../build/webrtc.gni")
-import("//testing/test.gni")
 
 group("stats") {
   deps = [
@@ -16,7 +15,7 @@
 }
 
 # GYP version: webrtc/stats/stats.gyp:rtc_stats
-source_set("rtc_stats") {
+rtc_source_set("rtc_stats") {
   cflags = []
   sources = [
     "rtcstats.cc",
@@ -31,7 +30,7 @@
 
   if (is_clang) {
     # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -41,7 +40,7 @@
 
 if (rtc_include_tests) {
   # GYP version: webrtc/stats/stats.gyp:rtc_stats_unittests
-  test("rtc_stats_unittests") {
+  rtc_test("rtc_stats_unittests") {
     testonly = true
     sources = [
       "rtcstats_unittest.cc",
@@ -54,7 +53,7 @@
 
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps = [
diff --git a/webrtc/system_wrappers/BUILD.gn b/webrtc/system_wrappers/BUILD.gn
index 8126f50..327c9af 100644
--- a/webrtc/system_wrappers/BUILD.gn
+++ b/webrtc/system_wrappers/BUILD.gn
@@ -10,10 +10,9 @@
   import("//build/config/android/config.gni")
   import("//build/config/android/rules.gni")
 }
-import("//testing/test.gni")
 import("../build/webrtc.gni")
 
-source_set("system_wrappers") {
+rtc_source_set("system_wrappers") {
   sources = [
     "include/aligned_array.h",
     "include/aligned_malloc.h",
@@ -135,13 +134,13 @@
 
   if (is_win && is_clang) {
     # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps += [ "../base:rtc_base_approved" ]
 }
 
-source_set("field_trial_default") {
+rtc_source_set("field_trial_default") {
   sources = [
     "include/field_trial_default.h",
     "source/field_trial_default.cc",
@@ -151,7 +150,7 @@
   public_configs = [ "..:common_inherited_config" ]
 }
 
-source_set("metrics_default") {
+rtc_source_set("metrics_default") {
   sources = [
     "include/metrics_default.h",
     "source/metrics_default.cc",
@@ -161,7 +160,7 @@
   public_configs = [ "..:common_inherited_config" ]
 }
 
-source_set("system_wrappers_default") {
+rtc_source_set("system_wrappers_default") {
   configs += [ "..:common_config" ]
   public_configs = [ "..:common_inherited_config" ]
 
@@ -173,7 +172,7 @@
 }
 
 if (is_android) {
-  source_set("cpu_features_android") {
+  rtc_source_set("cpu_features_android") {
     sources = [
       "source/cpu_features_android.c",
     ]
@@ -187,7 +186,7 @@
 }
 
 if (is_linux) {
-  source_set("cpu_features_linux") {
+  rtc_source_set("cpu_features_linux") {
     sources = [
       "source/cpu_features_linux.c",
     ]
@@ -198,7 +197,7 @@
 }
 
 if (rtc_include_tests) {
-  test("system_wrappers_unittests") {
+  rtc_test("system_wrappers_unittests") {
     testonly = true
     sources = [
       "source/aligned_array_unittest.cc",
@@ -233,7 +232,7 @@
     if (is_clang) {
       # Suppress warnings from Chrome's Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps = [
diff --git a/webrtc/test/BUILD.gn b/webrtc/test/BUILD.gn
index 993ff59..4b3cb3d 100644
--- a/webrtc/test/BUILD.gn
+++ b/webrtc/test/BUILD.gn
@@ -6,13 +6,13 @@
 # in the file PATENTS.  All contributing project authors may
 # be found in the AUTHORS file in the root of the source tree.
 
+import("../build/webrtc.gni")
 import("//build/config/ui.gni")
-import("//testing/test.gni")
 if (is_android) {
   import("//build/config/android/rules.gni")
 }
 
-source_set("test") {
+rtc_source_set("test") {
   testonly = true
 
   deps = [
@@ -50,7 +50,7 @@
   }
 }
 
-source_set("channel_transport") {
+rtc_source_set("channel_transport") {
   testonly = true
   sources = [
     "channel_transport/channel_transport.cc",
@@ -83,7 +83,7 @@
   if (is_clang && !is_nacl) {
     # Suppress warnings from the Chromium Clang plugin.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -93,7 +93,7 @@
   ]
 }
 
-source_set("video_test_common") {
+rtc_source_set("video_test_common") {
   testonly = true
   sources = [
     "fake_texture_frame.cc",
@@ -110,7 +110,7 @@
   if (is_clang && !is_nacl) {
     # Suppress warnings from the Chromium Clang plugin.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -118,7 +118,7 @@
   ]
 }
 
-source_set("rtp_test_utils") {
+rtc_source_set("rtp_test_utils") {
   testonly = true
   sources = [
     "rtcp_packet_parser.cc",
@@ -135,7 +135,7 @@
   if (is_clang && !is_nacl) {
     # Suppress warnings from the Chromium Clang plugin.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -145,7 +145,7 @@
   ]
 }
 
-source_set("field_trial") {
+rtc_source_set("field_trial") {
   testonly = true
   sources = [
     "field_trial.cc",
@@ -162,7 +162,7 @@
   public_configs = [ "..:common_inherited_config" ]
 }
 
-source_set("test_main") {
+rtc_source_set("test_main") {
   testonly = true
   sources = [
     "test_main.cc",
@@ -180,7 +180,7 @@
   public_configs = [ "..:common_inherited_config" ]
 }
 
-source_set("test_support") {
+rtc_source_set("test_support") {
   testonly = true
 
   sources = [
@@ -214,7 +214,7 @@
   if (is_clang) {
     # Suppress warnings from the Chromium Clang plugin.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   if (is_ios) {
@@ -235,7 +235,7 @@
 
 # Depend on this target when you want to have test_support but also the
 # main method needed for gtest to execute!
-source_set("test_support_main") {
+rtc_source_set("test_support_main") {
   testonly = true
 
   sources = [
@@ -263,7 +263,7 @@
 # This main will provide all the scaffolding and objective-c black magic
 # for you. All you need to do is to implement a function in the
 # run_threaded_main_mac.h file (ImplementThisToRunYourTest).
-source_set("test_support_main_threaded_mac") {
+rtc_source_set("test_support_main_threaded_mac") {
   testonly = true
 
   sources = [
@@ -301,7 +301,7 @@
   }
 }
 
-test("test_support_unittests") {
+rtc_test("test_support_unittests") {
   deps = []
   sources = [
     "channel_transport/udp_socket_manager_unittest.cc",
@@ -335,7 +335,7 @@
   if (is_clang) {
     # Suppress warnings from the Chromium Clang plugin.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   if (is_android) {
@@ -358,7 +358,7 @@
   ]
 }
 
-source_set("test_common") {
+rtc_source_set("test_common") {
   testonly = true
   sources = [
     "call_test.cc",
@@ -412,7 +412,7 @@
   if (is_clang && !is_nacl) {
     # Suppress warnings from the Chromium Clang plugin.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -444,7 +444,7 @@
   }
 }
 
-source_set("test_renderer") {
+rtc_source_set("test_renderer") {
   testonly = true
   libs = []
   sources = [
@@ -498,7 +498,7 @@
   if (is_clang && !is_nacl) {
     # Suppress warnings from the Chromium Clang plugin.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
diff --git a/webrtc/test/fuzzers/BUILD.gn b/webrtc/test/fuzzers/BUILD.gn
index 6928062..ee4275b 100644
--- a/webrtc/test/fuzzers/BUILD.gn
+++ b/webrtc/test/fuzzers/BUILD.gn
@@ -6,12 +6,12 @@
 # in the file PATENTS.  All contributing project authors may
 # be found in the AUTHORS file in the root of the source tree.
 
+import("../../build/webrtc.gni")
 import("//build/config/features.gni")
 import("//build_overrides/webrtc.gni")
 import("//testing/libfuzzer/fuzzer_test.gni")
-import("//testing/test.gni")
 
-static_library("webrtc_fuzzer_main") {
+rtc_static_library("webrtc_fuzzer_main") {
   public_configs = [ "../..:common_inherited_config" ]
   sources = [
     "webrtc_fuzzer_main.cc",
@@ -119,7 +119,7 @@
   ]
 }
 
-source_set("audio_decoder_fuzzer") {
+rtc_source_set("audio_decoder_fuzzer") {
   public_configs = [ "../..:common_inherited_config" ]
   sources = [
     "audio_decoder_fuzzer.cc",
diff --git a/webrtc/tools/BUILD.gn b/webrtc/tools/BUILD.gn
index c06a4b3..2e5df75 100644
--- a/webrtc/tools/BUILD.gn
+++ b/webrtc/tools/BUILD.gn
@@ -6,11 +6,10 @@
 # in the file PATENTS.  All contributing project authors may
 # be found in the AUTHORS file in the root of the source tree.
 
-import("//testing/test.gni")
 import("//third_party/protobuf/proto_library.gni")
 import("../build/webrtc.gni")
 
-source_set("tools") {
+rtc_source_set("tools") {
   deps = [
     ":command_line_parser",
   ]
@@ -24,7 +23,7 @@
   }
 }
 
-source_set("command_line_parser") {
+rtc_source_set("command_line_parser") {
   sources = [
     "simple_command_line_parser.cc",
     "simple_command_line_parser.h",
@@ -36,7 +35,7 @@
   public_configs = [ "..:common_inherited_config" ]
 }
 
-source_set("video_quality_analysis") {
+rtc_source_set("video_quality_analysis") {
   sources = [
     "frame_analyzer/video_quality_analysis.cc",
     "frame_analyzer/video_quality_analysis.h",
@@ -53,7 +52,7 @@
   ]
 }
 
-executable("frame_analyzer") {
+rtc_executable("frame_analyzer") {
   sources = [
     "frame_analyzer/frame_analyzer.cc",
   ]
@@ -69,7 +68,7 @@
   ]
 }
 
-executable("psnr_ssim_analyzer") {
+rtc_executable("psnr_ssim_analyzer") {
   sources = [
     "psnr_ssim_analyzer/psnr_ssim_analyzer.cc",
   ]
@@ -85,7 +84,7 @@
   ]
 }
 
-executable("rgba_to_i420_converter") {
+rtc_executable("rgba_to_i420_converter") {
   sources = [
     "converter/converter.cc",
     "converter/converter.h",
@@ -103,7 +102,7 @@
   ]
 }
 
-source_set("frame_editing_lib") {
+rtc_source_set("frame_editing_lib") {
   sources = [
     "frame_editing/frame_editing_lib.cc",
     "frame_editing/frame_editing_lib.h",
@@ -118,7 +117,7 @@
   if (is_clang) {
     # Suppress warnings from the Chromium Clang plugin.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -126,7 +125,7 @@
   ]
 }
 
-executable("frame_editor") {
+rtc_executable("frame_editor") {
   sources = [
     "frame_editing/frame_editing.cc",
   ]
@@ -142,7 +141,7 @@
   ]
 }
 
-executable("force_mic_volume_max") {
+rtc_executable("force_mic_volume_max") {
   sources = [
     "force_mic_volume_max/force_mic_volume_max.cc",
   ]
@@ -153,7 +152,7 @@
   if (is_clang) {
     # Suppress warnings from the Chromium Clang plugin.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -172,7 +171,7 @@
     proto_out_dir = "webrtc/tools/event_log_visualizer"
   }
 
-  source_set("event_log_visualizer_utils") {
+  rtc_source_set("event_log_visualizer_utils") {
     sources = [
       "event_log_visualizer/analyzer.cc",
       "event_log_visualizer/analyzer.h",
@@ -188,7 +187,7 @@
     if (is_clang && !is_nacl) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
     defines = [ "ENABLE_RTC_EVENT_LOG" ]
     deps = [
@@ -209,7 +208,7 @@
 # Exclude tools depending on gflags since that's not available in Chromium.
 if (rtc_include_tests) {
   if (rtc_enable_protobuf) {
-    executable("event_log_visualizer") {
+    rtc_executable("event_log_visualizer") {
       testonly = true
       sources = [
         "event_log_visualizer/main.cc",
@@ -221,7 +220,7 @@
       if (is_clang && !is_nacl) {
         # Suppress warnings from the Chromium Clang plugin.
         # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-        configs -= [ "//build/config/clang:find_bad_constructs" ]
+        suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
       }
 
       defines = [ "ENABLE_RTC_EVENT_LOG" ]
@@ -233,7 +232,7 @@
     }
   }
 
-  executable("activity_metric") {
+  rtc_executable("activity_metric") {
     testonly = true
     sources = [
       "agc/activity_metric.cc",
@@ -245,7 +244,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps = [
@@ -258,7 +257,7 @@
     ]
   }
 
-  executable("audio_e2e_harness") {
+  rtc_executable("audio_e2e_harness") {
     testonly = true
     sources = [
       "e2e_quality/audio/audio_e2e_harness.cc",
@@ -270,7 +269,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps = [
@@ -298,7 +297,7 @@
     }
   }
 
-  test("tools_unittests") {
+  rtc_test("tools_unittests") {
     testonly = true
 
     sources = [
@@ -316,7 +315,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
 
     deps = [
diff --git a/webrtc/video/BUILD.gn b/webrtc/video/BUILD.gn
index 76c2ea6..1d3f55c 100644
--- a/webrtc/video/BUILD.gn
+++ b/webrtc/video/BUILD.gn
@@ -7,9 +7,8 @@
 # be found in the AUTHORS file in the root of the source tree.
 
 import("../build/webrtc.gni")
-import("//testing/test.gni")
 
-source_set("video") {
+rtc_source_set("video") {
   sources = [
     "call_stats.cc",
     "call_stats.h",
@@ -55,7 +54,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -80,7 +79,7 @@
 
 if (rtc_include_tests) {
   # TODO(pbos): Rename test suite.
-  source_set("video_tests") {
+  rtc_source_set("video_tests") {
     testonly = true
     sources = [
       "call_stats_unittest.cc",
@@ -108,7 +107,7 @@
     if (is_clang) {
       # Suppress warnings from the Chromium Clang plugin.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 }
diff --git a/webrtc/voice_engine/BUILD.gn b/webrtc/voice_engine/BUILD.gn
index ffa17ed..02caffa 100644
--- a/webrtc/voice_engine/BUILD.gn
+++ b/webrtc/voice_engine/BUILD.gn
@@ -7,9 +7,8 @@
 # be found in the AUTHORS file in the root of the source tree.
 
 import("../build/webrtc.gni")
-import("//testing/test.gni")
 
-source_set("voice_engine") {
+rtc_source_set("voice_engine") {
   sources = [
     "channel.cc",
     "channel.h",
@@ -85,7 +84,7 @@
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
     # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
+    suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
   }
 
   deps = [
@@ -108,7 +107,7 @@
   ]
 }
 
-source_set("level_indicator") {
+rtc_source_set("level_indicator") {
   sources = [
     "level_indicator.cc",
     "level_indicator.h",
@@ -125,7 +124,7 @@
 }
 
 if (rtc_include_tests) {
-  test("voice_engine_unittests") {
+  rtc_test("voice_engine_unittests") {
     deps = [
       ":voice_engine",
       "//testing/gmock",
@@ -172,12 +171,12 @@
     if (is_clang) {
       # Suppress warnings from Chrome's Clang plugins.
       # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-      configs -= [ "//build/config/clang:find_bad_constructs" ]
+      suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
     }
   }
 
   if (!is_ios) {
-    executable("voe_auto_test") {
+    rtc_executable("voe_auto_test") {
       testonly = true
 
       deps = [
@@ -266,7 +265,7 @@
       if (is_clang) {
         # Suppress warnings from Chrome's Clang plugins.
         # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-        configs -= [ "//build/config/clang:find_bad_constructs" ]
+        suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
       }
     }
   }