Add isolate files for Android tests

BUG=chromium:583318
TESTED=Passing runs with:
GYP_DEFINES='test_isolation_mode=prepare OS=android' webrtc/build/gyp_webrtc
ninja -C out/Release
NOTRY=True
NOPRESUBMIT=True

Review URL: https://codereview.webrtc.org/1882963003

Cr-Commit-Position: refs/heads/master@{#12397}
diff --git a/.gitignore b/.gitignore
index 30b566c..5156e51 100644
--- a/.gitignore
+++ b/.gitignore
@@ -140,6 +140,7 @@
 /tools/grit
 /tools/gyp
 /tools/isolate_driver.py
+/tools/luci-go
 /tools/mb
 /tools/memory
 /tools/protoc_wrapper
diff --git a/setup_links.py b/setup_links.py
index 8823299..be59b26 100755
--- a/setup_links.py
+++ b/setup_links.py
@@ -68,6 +68,7 @@
   'tools/generate_stubs',
   'tools/gn',
   'tools/gyp',
+  'tools/luci-go',
   'tools/mb',
   'tools/memory',
   'tools/protoc_wrapper',
diff --git a/webrtc/api/api_tests.gyp b/webrtc/api/api_tests.gyp
index e66fa7f..0d08e7f 100644
--- a/webrtc/api/api_tests.gyp
+++ b/webrtc/api/api_tests.gyp
@@ -43,7 +43,7 @@
         'peerconnectionendtoend_unittest.cc',
         'peerconnectionfactory_unittest.cc',
         'peerconnectioninterface_unittest.cc',
-	'proxy_unittest.cc',
+        'proxy_unittest.cc',
         'rtpsenderreceiver_unittest.cc',
         'statscollector_unittest.cc',
         'test/fakeaudiocapturemodule.cc',
@@ -181,6 +181,27 @@
           ],
         },
       ],
+      'conditions': [
+        ['test_isolation_mode != "noop"',
+          {
+            'targets': [
+              {
+                'target_name': 'peerconnection_unittests_apk_run',
+                'type': 'none',
+                'dependencies': [
+                  '<(apk_tests_path):peerconnection_unittests_apk',
+                ],
+                'includes': [
+                  '../build/isolate.gypi',
+                ],
+                'sources': [
+                  'peerconnection_unittests_apk.isolate',
+                ],
+              },
+            ]
+          }
+        ],
+      ],
     }],  # OS=="android"
     ['test_isolation_mode != "noop"', {
       'targets': [
diff --git a/webrtc/api/peerconnection_unittests.isolate b/webrtc/api/peerconnection_unittests.isolate
index bc7db90..ad03ccf 100644
--- a/webrtc/api/peerconnection_unittests.isolate
+++ b/webrtc/api/peerconnection_unittests.isolate
@@ -1,28 +1,10 @@
+# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
 #
-# libjingle
-# Copyright 2013 Google Inc.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-#  1. Redistributions of source code must retain the above copyright notice,
-#     this list of conditions and the following disclaimer.
-#  2. Redistributions in binary form must reproduce the above copyright notice,
-#     this list of conditions and the following disclaimer in the documentation
-#     and/or other materials provided with the distribution.
-#  3. The name of the author may not be used to endorse or promote products
-#     derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
 
 {
   'conditions': [
diff --git a/webrtc/api/peerconnection_unittests_apk.isolate b/webrtc/api/peerconnection_unittests_apk.isolate
new file mode 100644
index 0000000..3b895e8
--- /dev/null
+++ b/webrtc/api/peerconnection_unittests_apk.isolate
@@ -0,0 +1,26 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+{
+  'includes': [
+    '../../build/android/android.isolate',
+    'peerconnection_unittests.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_peerconnection_unittests',
+      '--logcat-output-dir', '${ISOLATED_OUTDIR}/logcats',
+    ],
+    'files': [
+      '../../build/config/',
+      '../../third_party/instrumented_libraries/instrumented_libraries.isolate',
+      '<(PRODUCT_DIR)/peerconnection_unittests_apk/',
+      '<(PRODUCT_DIR)/bin/run_peerconnection_unittests',
+      'peerconnection_unittests.isolate',
+    ]
+  }
+}
diff --git a/webrtc/build/apk_tests.gyp b/webrtc/build/apk_tests.gyp
index 4839314..ba83acc 100644
--- a/webrtc/build/apk_tests.gyp
+++ b/webrtc/build/apk_tests.gyp
@@ -22,6 +22,21 @@
   },
   'targets': [
     {
+      'target_name': 'audio_codec_speed_tests_apk',
+      'type': 'none',
+      'variables': {
+        'test_suite_name': 'audio_codec_speed_tests',
+        'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)audio_codec_speed_tests<(SHARED_LIB_SUFFIX)',
+        'isolate_file': '../modules/audio_codec_speed_tests.isolate',
+      },
+      'dependencies': [
+        '<(webrtc_root)/modules/modules.gyp:audio_codec_speed_tests',
+      ],
+      'includes': [
+        '../../build/apk_test.gypi',
+      ],
+    },
+    {
       'target_name': 'audio_decoder_unittests_apk',
       'type': 'none',
       'variables': {
@@ -67,22 +82,6 @@
       ],
     },
     {
-      'target_name': 'peerconnection_unittests_apk',
-      'type': 'none',
-      'variables': {
-        'test_suite_name': 'peerconnection_unittests',
-        'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)peerconnection_unittests<(SHARED_LIB_SUFFIX)',
-        'isolate_file': '../api/peerconnection_unittests.isolate',
-      },
-      'dependencies': [
-        '<(webrtc_root)/api/api_tests.gyp:peerconnection_unittests',
-        '<(webrtc_root)/api/api.gyp:libjingle_peerconnection_java',
-      ],
-      'includes': [
-        '../../build/apk_test.gypi',
-      ],
-    },
-    {
       'target_name': 'modules_tests_apk',
       'type': 'none',
       'variables': {
@@ -114,6 +113,22 @@
       ],
     },
     {
+      'target_name': 'peerconnection_unittests_apk',
+      'type': 'none',
+      'variables': {
+        'test_suite_name': 'peerconnection_unittests',
+        'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)peerconnection_unittests<(SHARED_LIB_SUFFIX)',
+        'isolate_file': '../api/peerconnection_unittests.isolate',
+      },
+      'dependencies': [
+        '<(webrtc_root)/api/api_tests.gyp:peerconnection_unittests',
+        '<(webrtc_root)/api/api.gyp:libjingle_peerconnection_java',
+      ],
+      'includes': [
+        '../../build/apk_test.gypi',
+      ],
+    },
+    {
       'target_name': 'rtc_unittests_apk',
       'type': 'none',
       'variables': {
@@ -235,21 +250,6 @@
       ],
     },
     {
-      'target_name': 'audio_codec_speed_tests_apk',
-      'type': 'none',
-      'variables': {
-        'test_suite_name': 'audio_codec_speed_tests',
-        'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)audio_codec_speed_tests<(SHARED_LIB_SUFFIX)',
-        'isolate_file': '../modules/audio_codec_speed_tests.isolate',
-      },
-      'dependencies': [
-        '<(webrtc_root)/modules/modules.gyp:audio_codec_speed_tests',
-      ],
-      'includes': [
-        '../../build/apk_test.gypi',
-      ],
-    },
-    {
       'target_name': 'audio_device_java',
       'type': 'none',
       'variables': {
diff --git a/webrtc/common_audio/common_audio.gyp b/webrtc/common_audio/common_audio.gyp
index 57d9f1c..30ba322 100644
--- a/webrtc/common_audio/common_audio.gyp
+++ b/webrtc/common_audio/common_audio.gyp
@@ -294,7 +294,28 @@
               ],
             },
           ],
-        }],
+          'conditions': [
+            ['test_isolation_mode != "noop"',
+              {
+                'targets': [
+                  {
+                    'target_name': 'common_audio_unittests_apk_run',
+                    'type': 'none',
+                    'dependencies': [
+                      '<(apk_tests_path):common_audio_unittests_apk',
+                    ],
+                    'includes': [
+                      '../build/isolate.gypi',
+                    ],
+                    'sources': [
+                      'common_audio_unittests_apk.isolate',
+                    ],
+                  },
+                ],
+              },
+            ],
+          ],
+        }],  # OS=="android"
         ['test_isolation_mode != "noop"', {
           'targets': [
             {
diff --git a/webrtc/common_audio/common_audio_unittests_apk.isolate b/webrtc/common_audio/common_audio_unittests_apk.isolate
new file mode 100644
index 0000000..d426732
--- /dev/null
+++ b/webrtc/common_audio/common_audio_unittests_apk.isolate
@@ -0,0 +1,26 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+{
+  'includes': [
+    '../../build/android/android.isolate',
+    'common_audio_unittests.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_common_audio_unittests',
+      '--logcat-output-dir', '${ISOLATED_OUTDIR}/logcats',
+    ],
+    'files': [
+      '../../build/config/',
+      '../../third_party/instrumented_libraries/instrumented_libraries.isolate',
+      '<(PRODUCT_DIR)/common_audio_unittests_apk/',
+      '<(PRODUCT_DIR)/bin/run_common_audio_unittests',
+      'common_audio_unittests.isolate',
+    ]
+  }
+}
diff --git a/webrtc/common_video/common_video_unittests.gyp b/webrtc/common_video/common_video_unittests.gyp
index 545bfa4..5fa082a 100644
--- a/webrtc/common_video/common_video_unittests.gyp
+++ b/webrtc/common_video/common_video_unittests.gyp
@@ -54,7 +54,28 @@
           ],
         },
       ],
-    }],
+      'conditions': [
+        ['test_isolation_mode != "noop"',
+          {
+            'targets': [
+              {
+                'target_name': 'common_video_unittests_apk_run',
+                'type': 'none',
+                'dependencies': [
+                  '<(apk_tests_path):common_video_unittests_apk',
+                ],
+                'includes': [
+                  '../build/isolate.gypi',
+                ],
+                'sources': [
+                  'common_video_unittests_apk.isolate',
+                ],
+              },
+            ],
+          },
+        ],
+      ],
+    }],  # OS=="android"
     ['test_isolation_mode != "noop"', {
       'targets': [
         {
diff --git a/webrtc/common_video/common_video_unittests_apk.isolate b/webrtc/common_video/common_video_unittests_apk.isolate
new file mode 100644
index 0000000..36514cd
--- /dev/null
+++ b/webrtc/common_video/common_video_unittests_apk.isolate
@@ -0,0 +1,26 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+{
+  'includes': [
+    '../../build/android/android.isolate',
+    'common_video_unittests.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_common_video_unittests',
+      '--logcat-output-dir', '${ISOLATED_OUTDIR}/logcats',
+    ],
+    'files': [
+      '../../build/config/',
+      '../../third_party/instrumented_libraries/instrumented_libraries.isolate',
+      '<(PRODUCT_DIR)/common_video_unittests_apk/',
+      '<(PRODUCT_DIR)/bin/run_common_video_unittests',
+      'common_video_unittests.isolate',
+    ]
+  }
+}
diff --git a/webrtc/modules/audio_codec_speed_tests_apk.isolate b/webrtc/modules/audio_codec_speed_tests_apk.isolate
new file mode 100644
index 0000000..2122df8
--- /dev/null
+++ b/webrtc/modules/audio_codec_speed_tests_apk.isolate
@@ -0,0 +1,26 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+{
+  'includes': [
+    '../../build/android/android.isolate',
+    'audio_codec_speed_tests.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_audio_codec_speed_tests',
+      '--logcat-output-dir', '${ISOLATED_OUTDIR}/logcats',
+    ],
+    'files': [
+      '../../build/config/',
+      '../../third_party/instrumented_libraries/instrumented_libraries.isolate',
+      '<(PRODUCT_DIR)/audio_codec_speed_tests_apk/',
+      '<(PRODUCT_DIR)/bin/run_audio_codec_speed_tests',
+      'audio_codec_speed_tests.isolate',
+    ]
+  }
+}
diff --git a/webrtc/modules/audio_coding/audio_coding_tests.gypi b/webrtc/modules/audio_coding/audio_coding_tests.gypi
index e60309a..0b1a22d 100644
--- a/webrtc/modules/audio_coding/audio_coding_tests.gypi
+++ b/webrtc/modules/audio_coding/audio_coding_tests.gypi
@@ -39,17 +39,4 @@
       ],
     },
   ],
-  'conditions': [
-    ['OS=="android"', {
-      'targets': [
-        {
-          'target_name': 'audio_codec_speed_tests_apk_target',
-          'type': 'none',
-          'dependencies': [
-            '<(apk_tests_path):audio_codec_speed_tests_apk',
-          ],
-        },
-      ],
-    }],
-  ],
 }
diff --git a/webrtc/modules/audio_coding/neteq/neteq.gypi b/webrtc/modules/audio_coding/neteq/neteq.gypi
index ead9586..cbc8f24 100644
--- a/webrtc/modules/audio_coding/neteq/neteq.gypi
+++ b/webrtc/modules/audio_coding/neteq/neteq.gypi
@@ -206,19 +206,6 @@
           ],
         }, # neteq_unittest_tools
       ], # targets
-      'conditions': [
-        ['OS=="android"', {
-          'targets': [
-            {
-              'target_name': 'audio_decoder_unittests_apk_target',
-              'type': 'none',
-              'dependencies': [
-                '<(apk_tests_path):audio_decoder_unittests_apk',
-              ],
-            },
-          ],
-        }],
-      ],
     }], # include_tests
   ], # conditions
 }
diff --git a/webrtc/modules/audio_decoder_unittests_apk.isolate b/webrtc/modules/audio_decoder_unittests_apk.isolate
new file mode 100644
index 0000000..427559d
--- /dev/null
+++ b/webrtc/modules/audio_decoder_unittests_apk.isolate
@@ -0,0 +1,26 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+{
+  'includes': [
+    '../../build/android/android.isolate',
+    'audio_decoder_unittests.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_audio_decoder_unittests',
+      '--logcat-output-dir', '${ISOLATED_OUTDIR}/logcats',
+    ],
+    'files': [
+      '../../build/config/',
+      '../../third_party/instrumented_libraries/instrumented_libraries.isolate',
+      '<(PRODUCT_DIR)/audio_decoder_unittests_apk/',
+      '<(PRODUCT_DIR)/bin/run_audio_decoder_unittests',
+      'audio_decoder_unittests.isolate',
+    ]
+  }
+}
diff --git a/webrtc/modules/modules.gyp b/webrtc/modules/modules.gyp
index 8db5884..fd9279e 100644
--- a/webrtc/modules/modules.gyp
+++ b/webrtc/modules/modules.gyp
@@ -627,10 +627,17 @@
         ['OS=="android"', {
           'targets': [
             {
-              'target_name': 'modules_unittests_apk_target',
+              'target_name': 'audio_codec_speed_tests_apk_target',
               'type': 'none',
               'dependencies': [
-                '<(apk_tests_path):modules_unittests_apk',
+                '<(apk_tests_path):audio_codec_speed_tests_apk',
+              ],
+            },
+            {
+              'target_name': 'audio_decoder_unittests_apk_target',
+              'type': 'none',
+              'dependencies': [
+                '<(apk_tests_path):audio_decoder_unittests_apk',
               ],
             },
             {
@@ -640,8 +647,75 @@
                 '<(apk_tests_path):modules_tests_apk',
               ],
             },
+            {
+              'target_name': 'modules_unittests_apk_target',
+              'type': 'none',
+              'dependencies': [
+                '<(apk_tests_path):modules_unittests_apk',
+              ],
+            },
           ],
-        }],
+          'conditions': [
+            ['test_isolation_mode != "noop"',
+              {
+                'targets': [
+                  {
+                    'target_name': 'audio_codec_speed_tests_apk_run',
+                    'type': 'none',
+                    'dependencies': [
+                      '<(apk_tests_path):audio_codec_speed_tests_apk',
+                    ],
+                    'includes': [
+                      '../build/isolate.gypi',
+                    ],
+                    'sources': [
+                      'audio_codec_speed_tests_apk.isolate',
+                    ],
+                  },
+                  {
+                    'target_name': 'audio_decoder_unittests_apk_run',
+                    'type': 'none',
+                    'dependencies': [
+                      '<(apk_tests_path):audio_decoder_unittests_apk',
+                    ],
+                    'includes': [
+                      '../build/isolate.gypi',
+                    ],
+                    'sources': [
+                      'audio_decoder_unittests_apk.isolate',
+                    ],
+                  },
+                  {
+                    'target_name': 'modules_tests_apk_run',
+                    'type': 'none',
+                    'dependencies': [
+                      '<(apk_tests_path):modules_tests_apk',
+                    ],
+                    'includes': [
+                      '../build/isolate.gypi',
+                    ],
+                    'sources': [
+                      'modules_tests_apk.isolate',
+                    ],
+                  },
+                  {
+                    'target_name': 'modules_unittests_apk_run',
+                    'type': 'none',
+                    'dependencies': [
+                      '<(apk_tests_path):modules_unittests_apk',
+                    ],
+                    'includes': [
+                      '../build/isolate.gypi',
+                    ],
+                    'sources': [
+                      'modules_unittests_apk.isolate',
+                    ],
+                  },
+                ],
+              },
+            ],
+          ],
+        }],  # OS=="android"
         ['test_isolation_mode != "noop"', {
           'targets': [
             {
diff --git a/webrtc/modules/modules_tests_apk.isolate b/webrtc/modules/modules_tests_apk.isolate
new file mode 100644
index 0000000..ffdd967
--- /dev/null
+++ b/webrtc/modules/modules_tests_apk.isolate
@@ -0,0 +1,26 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+{
+  'includes': [
+    '../../build/android/android.isolate',
+    'modules_tests.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_modules_tests',
+      '--logcat-output-dir', '${ISOLATED_OUTDIR}/logcats',
+    ],
+    'files': [
+      '../../build/config/',
+      '../../third_party/instrumented_libraries/instrumented_libraries.isolate',
+      '<(PRODUCT_DIR)/modules_tests_apk/',
+      '<(PRODUCT_DIR)/bin/run_modules_tests',
+      'modules_tests.isolate',
+    ]
+  }
+}
diff --git a/webrtc/modules/modules_unittests_apk.isolate b/webrtc/modules/modules_unittests_apk.isolate
new file mode 100644
index 0000000..cd60cf7
--- /dev/null
+++ b/webrtc/modules/modules_unittests_apk.isolate
@@ -0,0 +1,26 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+{
+  'includes': [
+    '../../build/android/android.isolate',
+    'modules_unittests.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_modules_unittests',
+      '--logcat-output-dir', '${ISOLATED_OUTDIR}/logcats',
+    ],
+    'files': [
+      '../../build/config/',
+      '../../third_party/instrumented_libraries/instrumented_libraries.isolate',
+      '<(PRODUCT_DIR)/modules_unittests_apk/',
+      '<(PRODUCT_DIR)/bin/run_modules_unittests',
+      'modules_unittests.isolate',
+    ]
+  }
+}
diff --git a/webrtc/rtc_unittests_apk.isolate b/webrtc/rtc_unittests_apk.isolate
new file mode 100644
index 0000000..14fd20a
--- /dev/null
+++ b/webrtc/rtc_unittests_apk.isolate
@@ -0,0 +1,26 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+{
+  'includes': [
+    '../build/android/android.isolate',
+    'rtc_unittests.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_rtc_unittests',
+      '--logcat-output-dir', '${ISOLATED_OUTDIR}/logcats',
+    ],
+    'files': [
+      '../build/config/',
+      '../third_party/instrumented_libraries/instrumented_libraries.isolate',
+      '<(PRODUCT_DIR)/rtc_unittests_apk/',
+      '<(PRODUCT_DIR)/bin/run_rtc_unittests',
+      'rtc_unittests.isolate',
+    ]
+  },
+}
diff --git a/webrtc/system_wrappers/system_wrappers_tests.gyp b/webrtc/system_wrappers/system_wrappers_tests.gyp
index 863818b..174c96c 100644
--- a/webrtc/system_wrappers/system_wrappers_tests.gyp
+++ b/webrtc/system_wrappers/system_wrappers_tests.gyp
@@ -56,7 +56,7 @@
     },
   ],
   'conditions': [
-    ['include_tests==1 and OS=="android"', {
+    ['OS=="android"', {
       'targets': [
         {
           'target_name': 'system_wrappers_unittests_apk_target',
@@ -66,7 +66,28 @@
           ],
         },
       ],
-    }],
+      'conditions': [
+        ['test_isolation_mode != "noop"',
+          {
+            'targets': [
+              {
+                'target_name': 'system_wrappers_unittests_apk_run',
+                'type': 'none',
+                'dependencies': [
+                  '<(apk_tests_path):system_wrappers_unittests_apk',
+                ],
+                'includes': [
+                  '../build/isolate.gypi',
+                ],
+                'sources': [
+                  'system_wrappers_unittests_apk.isolate',
+                ],
+              },
+            ],
+          },
+        ],
+      ],
+    }],  # OS=="android"
     ['test_isolation_mode != "noop"', {
       'targets': [
         {
diff --git a/webrtc/system_wrappers/system_wrappers_unittests_apk.isolate b/webrtc/system_wrappers/system_wrappers_unittests_apk.isolate
new file mode 100644
index 0000000..974064a
--- /dev/null
+++ b/webrtc/system_wrappers/system_wrappers_unittests_apk.isolate
@@ -0,0 +1,26 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+{
+  'includes': [
+    '../../build/android/android.isolate',
+    'system_wrappers_unittests.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_system_wrappers_unittests',
+      '--logcat-output-dir', '${ISOLATED_OUTDIR}/logcats',
+    ],
+    'files': [
+      '../../build/config/',
+      '../../third_party/instrumented_libraries/instrumented_libraries.isolate',
+      '<(PRODUCT_DIR)/system_wrappers_unittests_apk/',
+      '<(PRODUCT_DIR)/bin/run_system_wrappers_unittests',
+      'system_wrappers_unittests.isolate',
+    ]
+  }
+}
diff --git a/webrtc/test/test.gyp b/webrtc/test/test.gyp
index ee3283e..01003eb 100644
--- a/webrtc/test/test.gyp
+++ b/webrtc/test/test.gyp
@@ -401,7 +401,7 @@
     },
   ],
   'conditions': [
-    ['include_tests==1 and OS=="android"', {
+    ['OS=="android"', {
       'targets': [
         {
           'target_name': 'test_support_unittests_apk_target',
@@ -411,7 +411,28 @@
           ],
         },
       ],
-    }],
+      'conditions': [
+        ['test_isolation_mode != "noop"',
+          {
+            'targets': [
+              {
+                'target_name': 'test_support_unittests_apk_run',
+                'type': 'none',
+                'dependencies': [
+                  '<(apk_tests_path):test_support_unittests_apk',
+                ],
+                'includes': [
+                  '../build/isolate.gypi',
+                ],
+                'sources': [
+                  'test_support_unittests_apk.isolate',
+                ],
+              },
+            ],
+          },
+        ],
+      ],
+    }],  # OS=="android"
     ['test_isolation_mode != "noop"', {
       'targets': [
         {
diff --git a/webrtc/test/test_support_unittests_apk.isolate b/webrtc/test/test_support_unittests_apk.isolate
new file mode 100644
index 0000000..e52980b
--- /dev/null
+++ b/webrtc/test/test_support_unittests_apk.isolate
@@ -0,0 +1,26 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+{
+  'includes': [
+    '../../build/android/android.isolate',
+    'test_support_unittests.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_test_support_unittests',
+      '--logcat-output-dir', '${ISOLATED_OUTDIR}/logcats',
+    ],
+    'files': [
+      '../../build/config/',
+      '../../third_party/instrumented_libraries/instrumented_libraries.isolate',
+      '<(PRODUCT_DIR)/test_support_unittests_apk/',
+      '<(PRODUCT_DIR)/bin/run_test_support_unittests',
+      'test_support_unittests.isolate',
+    ]
+  }
+}
diff --git a/webrtc/tools/tools.gyp b/webrtc/tools/tools.gyp
index b69f7cb..5a08ab9 100644
--- a/webrtc/tools/tools.gyp
+++ b/webrtc/tools/tools.gyp
@@ -189,6 +189,27 @@
               ],
             },
           ],
+          'conditions': [
+            ['test_isolation_mode != "noop"',
+              {
+                'targets': [
+                  {
+                    'target_name': 'tools_unittests_apk_run',
+                    'type': 'none',
+                    'dependencies': [
+                      '<(apk_tests_path):tools_unittests_apk',
+                    ],
+                    'includes': [
+                      '../build/isolate.gypi',
+                    ],
+                    'sources': [
+                      'tools_unittests_apk.isolate',
+                    ],
+                  },
+                ],
+              },
+            ],
+          ],
         }],
         ['test_isolation_mode != "noop"', {
           'targets': [
diff --git a/webrtc/tools/tools_unittests_apk.isolate b/webrtc/tools/tools_unittests_apk.isolate
new file mode 100644
index 0000000..a4ecb07
--- /dev/null
+++ b/webrtc/tools/tools_unittests_apk.isolate
@@ -0,0 +1,26 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+{
+  'includes': [
+    '../../build/android/android.isolate',
+    'tools_unittests.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_tools_unittests',
+      '--logcat-output-dir', '${ISOLATED_OUTDIR}/logcats',
+    ],
+    'files': [
+      '../../build/config/',
+      '../../third_party/instrumented_libraries/instrumented_libraries.isolate',
+      '<(PRODUCT_DIR)/tools_unittests_apk/',
+      '<(PRODUCT_DIR)/bin/run_tools_unittests',
+      'tools_unittests.isolate',
+    ]
+  }
+}
diff --git a/webrtc/video_engine_tests_apk.isolate b/webrtc/video_engine_tests_apk.isolate
new file mode 100644
index 0000000..6f4c3d4
--- /dev/null
+++ b/webrtc/video_engine_tests_apk.isolate
@@ -0,0 +1,26 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+{
+  'includes': [
+    '../build/android/android.isolate',
+    'video_engine_tests.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_video_engine_tests',
+      '--logcat-output-dir', '${ISOLATED_OUTDIR}/logcats',
+    ],
+    'files': [
+      '../build/config/',
+      '../third_party/instrumented_libraries/instrumented_libraries.isolate',
+      '<(PRODUCT_DIR)/video_engine_tests_apk/',
+      '<(PRODUCT_DIR)/bin/run_video_engine_tests',
+      'video_engine_tests.isolate',
+    ]
+  }
+}
diff --git a/webrtc/voice_engine/voice_engine.gyp b/webrtc/voice_engine/voice_engine.gyp
index b93c903..a728b1a 100644
--- a/webrtc/voice_engine/voice_engine.gyp
+++ b/webrtc/voice_engine/voice_engine.gyp
@@ -255,6 +255,27 @@
               ],
             },
           ],
+          'conditions': [
+            ['test_isolation_mode != "noop"',
+              {
+                'targets': [
+                  {
+                    'target_name': 'voice_engine_unittests_apk_run',
+                    'type': 'none',
+                    'dependencies': [
+                      '<(apk_tests_path):voice_engine_unittests_apk',
+                    ],
+                    'includes': [
+                      '../build/isolate.gypi',
+                    ],
+                    'sources': [
+                      'voice_engine_unittests_apk.isolate',
+                    ],
+                  },
+                ],
+              },
+            ],
+          ],
         }],
         ['test_isolation_mode != "noop"', {
           'targets': [
diff --git a/webrtc/voice_engine/voice_engine_unittests_apk.isolate b/webrtc/voice_engine/voice_engine_unittests_apk.isolate
new file mode 100644
index 0000000..6f0244c
--- /dev/null
+++ b/webrtc/voice_engine/voice_engine_unittests_apk.isolate
@@ -0,0 +1,26 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+{
+  'includes': [
+    '../../build/android/android.isolate',
+    'voice_engine_unittests.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_voice_engine_unittests',
+      '--logcat-output-dir', '${ISOLATED_OUTDIR}/logcats',
+    ],
+    'files': [
+      '../../build/config/',
+      '../../third_party/instrumented_libraries/instrumented_libraries.isolate',
+      '<(PRODUCT_DIR)/voice_engine_unittests_apk/',
+      '<(PRODUCT_DIR)/bin/run_voice_engine_unittests',
+      'voice_engine_unittests.isolate',
+    ]
+  }
+}
diff --git a/webrtc/webrtc_nonparallel_tests_apk.isolate b/webrtc/webrtc_nonparallel_tests_apk.isolate
new file mode 100644
index 0000000..ee83d10
--- /dev/null
+++ b/webrtc/webrtc_nonparallel_tests_apk.isolate
@@ -0,0 +1,26 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+{
+  'includes': [
+    '../build/android/android.isolate',
+    'webrtc_nonparallel_tests.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_webrtc_nonparallel_tests',
+      '--logcat-output-dir', '${ISOLATED_OUTDIR}/logcats',
+    ],
+    'files': [
+      '../build/config/',
+      '../third_party/instrumented_libraries/instrumented_libraries.isolate',
+      '<(PRODUCT_DIR)/webrtc_nonparallel_tests_apk/',
+      '<(PRODUCT_DIR)/bin/run_webrtc_nonparallel_tests',
+      'webrtc_nonparallel_tests.isolate',
+    ]
+  },
+}
diff --git a/webrtc/webrtc_perf_tests_apk.isolate b/webrtc/webrtc_perf_tests_apk.isolate
new file mode 100644
index 0000000..d1be691
--- /dev/null
+++ b/webrtc/webrtc_perf_tests_apk.isolate
@@ -0,0 +1,26 @@
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
+#
+# Use of this source code is governed by a BSD-style license
+# that can be found in the LICENSE file in the root of the source
+# tree. An additional intellectual property rights grant can be found
+# in the file PATENTS.  All contributing project authors may
+# be found in the AUTHORS file in the root of the source tree.
+{
+  'includes': [
+    '../build/android/android.isolate',
+    'webrtc_perf_tests.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_webrtc_perf_tests',
+      '--logcat-output-dir', '${ISOLATED_OUTDIR}/logcats',
+    ],
+    'files': [
+      '../build/config/',
+      '../third_party/instrumented_libraries/instrumented_libraries.isolate',
+      '<(PRODUCT_DIR)/webrtc_perf_tests_apk/',
+      '<(PRODUCT_DIR)/bin/run_webrtc_perf_tests',
+      'webrtc_perf_tests.isolate',
+    ]
+  },
+}
diff --git a/webrtc/webrtc_tests.gypi b/webrtc/webrtc_tests.gypi
index 7840e80..229f7b6 100644
--- a/webrtc/webrtc_tests.gypi
+++ b/webrtc/webrtc_tests.gypi
@@ -343,6 +343,66 @@
           ],
         },
       ],
+      'conditions': [
+        ['test_isolation_mode != "noop"',
+          {
+            'targets': [
+              {
+                'target_name': 'rtc_unittests_apk_run',
+                'type': 'none',
+                'dependencies': [
+                  '<(apk_tests_path):rtc_unittests_apk',
+                ],
+                'includes': [
+                  'build/isolate.gypi',
+                ],
+                'sources': [
+                  'rtc_unittests_apk.isolate',
+                ],
+              },
+              {
+                'target_name': 'video_engine_tests_apk_run',
+                'type': 'none',
+                'dependencies': [
+                  '<(apk_tests_path):video_engine_tests_apk',
+                ],
+                'includes': [
+                  'build/isolate.gypi',
+                ],
+                'sources': [
+                  'video_engine_tests_apk.isolate',
+                ],
+              },
+              {
+                'target_name': 'webrtc_perf_tests_apk_run',
+                'type': 'none',
+                'dependencies': [
+                  '<(apk_tests_path):webrtc_perf_tests_apk',
+                ],
+                'includes': [
+                  'build/isolate.gypi',
+                ],
+                'sources': [
+                  'webrtc_perf_tests_apk.isolate',
+                ],
+              },
+              {
+                'target_name': 'webrtc_nonparallel_tests_apk_run',
+                'type': 'none',
+                'dependencies': [
+                  '<(apk_tests_path):webrtc_nonparallel_tests_apk',
+                ],
+                'includes': [
+                  'build/isolate.gypi',
+                ],
+                'sources': [
+                  'webrtc_nonparallel_tests_apk.isolate',
+                ],
+              },
+            ],
+          },
+        ],
+      ],
     }],
     ['test_isolation_mode != "noop"', {
       'targets': [