Adds all unittests to android NDK-APK framework.

BUG=N/A
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/1872004

git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@4474 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/build/apk_tests.gyp b/build/apk_tests.gyp
index 6ed744e..f39384d 100644
--- a/build/apk_tests.gyp
+++ b/build/apk_tests.gyp
@@ -15,30 +15,178 @@
 # WebRTC when built as part of Chromium and when it is built without Chromium.
 {
   'includes': [
-    '../build/common.gypi',
+    'common.gypi',
   ],
   'targets': [
     {
-      'target_name': 'modules_unittests_apk',
+      'target_name': 'audio_decoder_unittests_apk',
       'type': 'none',
-      'conditions': [
-        # TODO(henrike): remove build_with_chromium==1 when the bots are using
-        # Chromium's buildbots.
-        ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
-          'variables': {
-            'test_suite_name': 'modules_unittests',
-            'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)modules_unittests<(SHARED_LIB_SUFFIX)',
-          },
-          'dependencies': [
-            '<(webrtc_root)/modules/modules.gyp:modules_unittests',
-          ],
-          'includes': [
-            '../../../build/apk_test.gypi',
-          ],
-        }],
+      'variables': {
+        'test_suite_name': 'audio_decoder_unittests',
+        'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)audio_decoder_unittests<(SHARED_LIB_SUFFIX)',
+      },
+      'dependencies': [
+        '<(webrtc_root)/modules/modules.gyp:audio_decoder_unittests',
+      ],
+      'includes': [
+        '../../../build/apk_test.gypi',
       ],
     },
-  ]
+    {
+      'target_name': 'common_audio_unittests_apk',
+      'type': 'none',
+      'variables': {
+        'test_suite_name': 'common_audio_unittests',
+        'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)common_audio_unittests<(SHARED_LIB_SUFFIX)',
+      },
+      'dependencies': [
+        '<(webrtc_root)/common_audio/common_audio.gyp:common_audio_unittests',
+      ],
+      'includes': [
+        '../../../build/apk_test.gypi',
+      ],
+    },
+    {
+      'target_name': 'common_video_unittests_apk',
+      'type': 'none',
+      'variables': {
+        'test_suite_name': 'common_video_unittests',
+        'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)common_video_unittests<(SHARED_LIB_SUFFIX)',
+      },
+      'dependencies': [
+        '<(webrtc_root)/common_video/common_video.gyp:common_video_unittests',
+      ],
+      'includes': [
+        '../../../build/apk_test.gypi',
+      ],
+    },
+    {
+      'target_name': 'metrics_unittests_apk',
+      'type': 'none',
+      'variables': {
+        'test_suite_name': 'metrics_unittests',
+        'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)metrics_unittests<(SHARED_LIB_SUFFIX)',
+      },
+      'dependencies': [
+        '<(webrtc_root)/test/metrics.gyp:metrics_unittests',
+      ],
+      'includes': [
+        '../../../build/apk_test.gypi',
+      ],
+    },
+    {
+      'target_name': 'modules_integrationtests_apk',
+      'type': 'none',
+      'variables': {
+        'test_suite_name': 'modules_integrationtests',
+        'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)modules_integrationtests<(SHARED_LIB_SUFFIX)',
+      },
+      'dependencies': [
+        '<(webrtc_root)/modules/modules.gyp:modules_integrationtests',
+      ],
+      'includes': [
+        '../../../build/apk_test.gypi',
+      ],
+    },
+    {
+      'target_name': 'modules_unittests_apk',
+      'type': 'none',
+      'variables': {
+        'test_suite_name': 'modules_unittests',
+        'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)modules_unittests<(SHARED_LIB_SUFFIX)',
+      },
+      'dependencies': [
+        '<(webrtc_root)/modules/modules.gyp:modules_unittests',
+      ],
+      'includes': [
+        '../../../build/apk_test.gypi',
+      ],
+    },
+    {
+      'target_name': 'neteq_unittests_apk',
+      'type': 'none',
+      'variables': {
+        'test_suite_name': 'neteq_unittests',
+        'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)neteq_unittests<(SHARED_LIB_SUFFIX)',
+      },
+      'dependencies': [
+        '<(webrtc_root)/modules/modules.gyp:neteq_unittests',
+      ],
+      'includes': [
+        '../../../build/apk_test.gypi',
+      ],
+    },
+    {
+      'target_name': 'system_wrappers_unittests_apk',
+      'type': 'none',
+      'variables': {
+        'test_suite_name': 'system_wrappers_unittests',
+        'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)system_wrappers_unittests<(SHARED_LIB_SUFFIX)',
+      },
+      'dependencies': [
+        '<(webrtc_root)/system_wrappers/source/system_wrappers_tests.gyp:system_wrappers_unittests',
+      ],
+      'includes': [
+        '../../../build/apk_test.gypi',
+      ],
+    },
+    {
+      'target_name': 'test_support_unittests_apk',
+      'type': 'none',
+      'variables': {
+        'test_suite_name': 'test_support_unittests',
+        'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)test_support_unittests<(SHARED_LIB_SUFFIX)',
+      },
+      'dependencies': [
+        '<(webrtc_root)/test/test.gyp:test_support_unittests',
+      ],
+      'includes': [
+        '../../../build/apk_test.gypi',
+      ],
+    },
+    {
+      'target_name': 'tools_unittests_apk',
+      'type': 'none',
+      'variables': {
+        'test_suite_name': 'tools_unittests',
+        'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)tools_unittests<(SHARED_LIB_SUFFIX)',
+      },
+      'dependencies': [
+        '<(webrtc_root)/tools/tools.gyp:tools_unittests',
+      ],
+      'includes': [
+        '../../../build/apk_test.gypi',
+      ],
+    },
+    {
+      'target_name': 'video_engine_core_unittests_apk',
+      'type': 'none',
+      'variables': {
+        'test_suite_name': 'video_engine_core_unittests',
+        'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)video_engine_core_unittests<(SHARED_LIB_SUFFIX)',
+      },
+      'dependencies': [
+        '<(webrtc_root)/video_engine/video_engine.gyp:video_engine_core_unittests',
+      ],
+      'includes': [
+        '../../../build/apk_test.gypi',
+      ],
+    },
+    {
+      'target_name': 'voice_engine_unittests_apk',
+      'type': 'none',
+      'variables': {
+        'test_suite_name': 'voice_engine_unittests',
+        'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)voice_engine_unittests<(SHARED_LIB_SUFFIX)',
+      },
+      'dependencies': [
+        '<(webrtc_root)/voice_engine/voice_engine.gyp:voice_engine_unittests',
+      ],
+      'includes': [
+        '../../../build/apk_test.gypi',
+      ],
+    },    
+  ],
 }
-  
-  
+
+
diff --git a/build/apk_tests_noop.gyp b/build/apk_tests_noop.gyp
index d9c7ca1..2c51703 100644
--- a/build/apk_tests_noop.gyp
+++ b/build/apk_tests_noop.gyp
@@ -10,7 +10,52 @@
 {
   'targets': [
     {
+      'target_name': 'audio_decoder_unittests_apk',
+      'type': 'none',
+    },
+    {
+      'target_name': 'common_audio_unittests_apk',
+      'type': 'none',
+    },
+    {
+      'target_name': 'common_video_unittests_apk',
+      'type': 'none',
+    },
+    {
+      'target_name': 'metrics_unittests',
+      'type': 'none',
+    },
+    {
+      'target_name': 'modules_integrationtests_apk',
+      'type': 'none',
+    },
+    {
       'target_name': 'modules_unittests_apk',
       'type': 'none',
-    }],
+    },
+    {
+      'target_name': 'neteq_unittests_apk',
+      'type': 'none',
+    },
+    {
+      'target_name': 'system_wrappers_unittests_apk',
+      'type': 'none',
+    },
+    {
+      'target_name': 'test_support_unittests_apk',
+      'type': 'none',
+    },
+    {
+      'target_name': 'tools_unittests_apk',
+      'type': 'none',
+    },
+    {
+      'target_name': 'video_engine_core_unittests_apk',
+      'type': 'none',
+    },
+    {
+      'target_name': 'voice_engine_unittests_apk',
+      'type': 'none',
+    },
+  ],
 }
diff --git a/common_audio/common_audio.gyp b/common_audio/common_audio.gyp
index a931e91..7955d23 100644
--- a/common_audio/common_audio.gyp
+++ b/common_audio/common_audio.gyp
@@ -170,7 +170,7 @@
       'targets' : [
         {
           'target_name': 'common_audio_unittests',
-          'type': 'executable',
+          'type': '<(gtest_target_type)',
           'dependencies': [
             'common_audio',
             '<(webrtc_root)/test/test.gyp:test_support_main',
@@ -194,8 +194,32 @@
             'vad/vad_unittest.cc',
             'vad/vad_unittest.h',
           ],
+          'conditions': [
+            # TODO(henrike): remove build_with_chromium==1 when the bots are
+            # using Chromium's buildbots.
+            ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+              'dependencies': [
+                '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
+              ],
+            }],
+          ],
         },
       ],  # targets
+      'conditions': [
+        # TODO(henrike): remove build_with_chromium==1 when the bots are using
+        # Chromium's buildbots.
+        ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+          'targets': [
+            {
+              'target_name': 'common_audio_unittests_apk_target',
+              'type': 'none',
+              'dependencies': [
+                '<(apk_tests_path):common_audio_unittests_apk',
+              ],
+            },
+          ],
+        }],
+      ]
     }],
   ],  # conditions
 }
diff --git a/common_video/common_video.gyp b/common_video/common_video.gyp
index 05ddd9d..8be60cd 100644
--- a/common_video/common_video.gyp
+++ b/common_video/common_video.gyp
@@ -75,7 +75,7 @@
       'targets': [
         {
           'target_name': 'common_video_unittests',
-          'type': 'executable',
+          'type': '<(gtest_target_type)',
           'dependencies': [
              'common_video',
              '<(DEPTH)/testing/gtest.gyp:gtest',
@@ -93,8 +93,32 @@
           'msvs_disabled_warnings': [
             4267,  # size_t to int truncation.
           ],
+          'conditions': [
+            # TODO(henrike): remove build_with_chromium==1 when the bots are
+            # using Chromium's buildbots.
+            ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+              'dependencies': [
+                '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
+              ],
+            }],
+          ],
         },
       ],  # targets
+      'conditions': [
+        # TODO(henrike): remove build_with_chromium==1 when the bots are using
+        # Chromium's buildbots.
+        ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+          'targets': [
+            {
+              'target_name': 'common_video_unittests_apk_target',
+              'type': 'none',
+              'dependencies': [
+                '<(apk_tests_path):common_video_unittests_apk',
+              ],
+            },
+          ],
+        }],
+      ],
     }],  # include_tests
   ],
-}
\ No newline at end of file
+}
diff --git a/common_video/libyuv/scaler_unittest.cc b/common_video/libyuv/scaler_unittest.cc
index 421e06c..60340ac 100644
--- a/common_video/libyuv/scaler_unittest.cc
+++ b/common_video/libyuv/scaler_unittest.cc
@@ -15,6 +15,7 @@
 #include "webrtc/common_video/libyuv/include/scaler.h"
 #include "webrtc/system_wrappers/interface/tick_util.h"
 #include "webrtc/test/testsupport/fileutils.h"
+#include "webrtc/test/testsupport/gtest_disable.h"
 
 namespace webrtc {
 
@@ -117,7 +118,7 @@
 }
 
 //TODO (mikhal): Converge the test into one function that accepts the method.
-TEST_F(TestScaler, PointScaleTest) {
+TEST_F(TestScaler, DISABLED_ON_ANDROID(PointScaleTest)) {
   double avg_psnr;
   FILE* source_file2;
   ScaleMethod method = kScalePoint;
@@ -204,7 +205,7 @@
   ASSERT_EQ(0, fclose(source_file2));
 }
 
-TEST_F(TestScaler, BiLinearScaleTest) {
+TEST_F(TestScaler, DISABLED_ON_ANDROID(BiLinearScaleTest)) {
   double avg_psnr;
   FILE* source_file2;
   ScaleMethod method = kScaleBilinear;
@@ -298,7 +299,7 @@
   ASSERT_EQ(0, fclose(source_file2));
 }
 
-TEST_F(TestScaler, BoxScaleTest) {
+TEST_F(TestScaler, DISABLED_ON_ANDROID(BoxScaleTest)) {
   double avg_psnr;
   FILE* source_file2;
   ScaleMethod method = kScaleBox;
diff --git a/modules/audio_coding/main/test/Tester.cc b/modules/audio_coding/main/test/Tester.cc
index a17d5cd..923e537 100644
--- a/modules/audio_coding/main/test/Tester.cc
+++ b/modules/audio_coding/main/test/Tester.cc
@@ -25,6 +25,7 @@
 #include "webrtc/modules/audio_coding/main/test/TwoWayCommunication.h"
 #include "webrtc/system_wrappers/interface/trace.h"
 #include "webrtc/test/testsupport/fileutils.h"
+#include "webrtc/test/testsupport/gtest_disable.h"
 
 using webrtc::AudioCodingModule;
 using webrtc::Trace;
@@ -136,7 +137,7 @@
   Trace::ReturnTrace();
 }
 
-TEST(AudioCodingModuleTest, RunAllTests) {
+TEST(AudioCodingModuleTest, DISABLED_ON_ANDROID(RunAllTests)) {
   std::vector<ACMTest*> tests;
   PopulateTests(&tests);
   std::vector<ACMTest*>::iterator it;
diff --git a/modules/audio_coding/main/test/dual_stream_unittest.cc b/modules/audio_coding/main/test/dual_stream_unittest.cc
index dc087db..9130d97 100644
--- a/modules/audio_coding/main/test/dual_stream_unittest.cc
+++ b/modules/audio_coding/main/test/dual_stream_unittest.cc
@@ -16,6 +16,7 @@
 #include "scoped_ptr.h"
 #include "testsupport/fileutils.h"
 #include "typedefs.h"
+#include "webrtc/test/testsupport/gtest_disable.h"
 
 namespace webrtc {
 
@@ -383,91 +384,105 @@
 }
 
 // Mono input, mono primary WB 20 ms frame.
-TEST_F(DualStreamTest, BitExactSyncMonoInputMonoPrimaryWb20Ms) {
+TEST_F(DualStreamTest,
+       DISABLED_ON_ANDROID(BitExactSyncMonoInputMonoPrimaryWb20Ms)) {
   InitializeSender(20, 1, 16000);
   Perform(true, 1);
 }
 
 // Mono input, stereo primary WB 20 ms frame.
-TEST_F(DualStreamTest, BitExactSyncMonoInput_StereoPrimaryWb20Ms) {
+TEST_F(DualStreamTest,
+       DISABLED_ON_ANDROID(BitExactSyncMonoInput_StereoPrimaryWb20Ms)) {
   InitializeSender(20, 2, 16000);
   Perform(true, 1);
 }
 
 // Mono input, mono primary SWB 20 ms frame.
-TEST_F(DualStreamTest, BitExactSyncMonoInputMonoPrimarySwb20Ms) {
+TEST_F(DualStreamTest,
+       DISABLED_ON_ANDROID(BitExactSyncMonoInputMonoPrimarySwb20Ms)) {
   InitializeSender(20, 1, 32000);
   Perform(true, 1);
 }
 
 // Mono input, stereo primary SWB 20 ms frame.
-TEST_F(DualStreamTest, BitExactSyncMonoInputStereoPrimarySwb20Ms) {
+TEST_F(DualStreamTest,
+       DISABLED_ON_ANDROID(BitExactSyncMonoInputStereoPrimarySwb20Ms)) {
   InitializeSender(20, 2, 32000);
   Perform(true, 1);
 }
 
 // Mono input, mono primary WB 40 ms frame.
-TEST_F(DualStreamTest, BitExactSyncMonoInputMonoPrimaryWb40Ms) {
+TEST_F(DualStreamTest,
+       DISABLED_ON_ANDROID(BitExactSyncMonoInputMonoPrimaryWb40Ms)) {
   InitializeSender(40, 1, 16000);
   Perform(true, 1);
 }
 
 // Mono input, stereo primary WB 40 ms frame
-TEST_F(DualStreamTest, BitExactSyncMonoInputStereoPrimaryWb40Ms) {
+TEST_F(DualStreamTest,
+       DISABLED_ON_ANDROID(BitExactSyncMonoInputStereoPrimaryWb40Ms)) {
   InitializeSender(40, 2, 16000);
   Perform(true, 1);
 }
 
 // Stereo input, mono primary WB 20 ms frame.
-TEST_F(DualStreamTest, BitExactSyncStereoInputMonoPrimaryWb20Ms) {
+TEST_F(DualStreamTest,
+       DISABLED_ON_ANDROID(BitExactSyncStereoInputMonoPrimaryWb20Ms)) {
   InitializeSender(20, 1, 16000);
   Perform(true, 2);
 }
 
 // Stereo input, stereo primary WB 20 ms frame.
-TEST_F(DualStreamTest, BitExactSyncStereoInputStereoPrimaryWb20Ms) {
+TEST_F(DualStreamTest,
+       DISABLED_ON_ANDROID(BitExactSyncStereoInputStereoPrimaryWb20Ms)) {
   InitializeSender(20, 2, 16000);
   Perform(true, 2);
 }
 
 // Stereo input, mono primary SWB 20 ms frame.
-TEST_F(DualStreamTest, BitExactSyncStereoInputMonoPrimarySwb20Ms) {
+TEST_F(DualStreamTest,
+       DISABLED_ON_ANDROID(BitExactSyncStereoInputMonoPrimarySwb20Ms)) {
   InitializeSender(20, 1, 32000);
   Perform(true, 2);
 }
 
 // Stereo input, stereo primary SWB 20 ms frame.
-TEST_F(DualStreamTest, BitExactSyncStereoInputStereoPrimarySwb20Ms) {
+TEST_F(DualStreamTest,
+       DISABLED_ON_ANDROID(BitExactSyncStereoInputStereoPrimarySwb20Ms)) {
   InitializeSender(20, 2, 32000);
   Perform(true, 2);
 }
 
 // Stereo input, mono primary WB 40 ms frame.
-TEST_F(DualStreamTest, BitExactSyncStereoInputMonoPrimaryWb40Ms) {
+TEST_F(DualStreamTest,
+       DISABLED_ON_ANDROID(BitExactSyncStereoInputMonoPrimaryWb40Ms)) {
   InitializeSender(40, 1, 16000);
   Perform(true, 2);
 }
 
 // Stereo input, stereo primary WB 40 ms frame.
-TEST_F(DualStreamTest, BitExactSyncStereoInputStereoPrimaryWb40Ms) {
+TEST_F(DualStreamTest,
+       DISABLED_ON_ANDROID(BitExactSyncStereoInputStereoPrimaryWb40Ms)) {
   InitializeSender(40, 2, 16000);
   Perform(true, 2);
 }
 
 // Asynchronous test, ACM is fed with data then secondary coder is registered.
 // Mono input, mono primary WB 20 ms frame.
-TEST_F(DualStreamTest, BitExactAsyncMonoInputMonoPrimaryWb20Ms) {
+TEST_F(DualStreamTest,
+       DISABLED_ON_ANDROID(BitExactAsyncMonoInputMonoPrimaryWb20Ms)) {
   InitializeSender(20, 1, 16000);
   Perform(false, 1);
 }
 
 // Mono input, mono primary WB 20 ms frame.
-TEST_F(DualStreamTest, BitExactAsyncMonoInputMonoPrimaryWb40Ms) {
+TEST_F(DualStreamTest,
+       DISABLED_ON_ANDROID(BitExactAsyncMonoInputMonoPrimaryWb40Ms)) {
   InitializeSender(40, 1, 16000);
   Perform(false, 1);
 }
 
-TEST_F(DualStreamTest, Api) {
+TEST_F(DualStreamTest, DISABLED_ON_ANDROID(Api)) {
   PopulateCodecInstances(20, 1, 16000);
   CodecInst my_codec;
   ASSERT_EQ(0, acm_dual_stream_->InitializeSender());
diff --git a/modules/audio_coding/main/test/initial_delay_unittest.cc b/modules/audio_coding/main/test/initial_delay_unittest.cc
index 64240af..618ccb5 100644
--- a/modules/audio_coding/main/test/initial_delay_unittest.cc
+++ b/modules/audio_coding/main/test/initial_delay_unittest.cc
@@ -25,6 +25,7 @@
 #include "webrtc/modules/audio_coding/main/test/utility.h"
 #include "webrtc/system_wrappers/interface/event_wrapper.h"
 #include "webrtc/system_wrappers/interface/scoped_ptr.h"
+#include "webrtc/test/testsupport/gtest_disable.h"
 
 namespace webrtc {
 
@@ -129,38 +130,38 @@
   Channel* channel_a2b_;
 };
 
-TEST_F( InitialPlayoutDelayTest, NbMono) {
+TEST_F( InitialPlayoutDelayTest, DISABLED_ON_ANDROID(NbMono)) {
   CodecInst codec;
   AudioCodingModule::Codec("L16", &codec, 8000, 1);
   Run(codec, 3000);
 }
 
-TEST_F( InitialPlayoutDelayTest, WbMono) {
+TEST_F( InitialPlayoutDelayTest, DISABLED_ON_ANDROID(WbMono)) {
   CodecInst codec;
   AudioCodingModule::Codec("L16", &codec, 16000, 1);
   Run(codec, 3000);
 }
 
-TEST_F( InitialPlayoutDelayTest, SwbMono) {
+TEST_F( InitialPlayoutDelayTest, DISABLED_ON_ANDROID(SwbMono)) {
   CodecInst codec;
   AudioCodingModule::Codec("L16", &codec, 32000, 1);
   Run(codec, 2000);  // NetEq buffer is not sufficiently large for 3 sec of
                      // PCM16 super-wideband.
 }
 
-TEST_F( InitialPlayoutDelayTest, NbStereo) {
+TEST_F( InitialPlayoutDelayTest, DISABLED_ON_ANDROID(NbStereo)) {
   CodecInst codec;
   AudioCodingModule::Codec("L16", &codec, 8000, 2);
   Run(codec, 3000);
 }
 
-TEST_F( InitialPlayoutDelayTest, WbStereo) {
+TEST_F( InitialPlayoutDelayTest, DISABLED_ON_ANDROID(WbStereo)) {
   CodecInst codec;
   AudioCodingModule::Codec("L16", &codec, 16000, 2);
   Run(codec, 3000);
 }
 
-TEST_F( InitialPlayoutDelayTest, SwbStereo) {
+TEST_F( InitialPlayoutDelayTest, DISABLED_ON_ANDROID(SwbStereo)) {
   CodecInst codec;
   AudioCodingModule::Codec("L16", &codec, 32000, 2);
   Run(codec, 2000);  // NetEq buffer is not sufficiently large for 3 sec of
diff --git a/modules/audio_coding/main/test/target_delay_unittest.cc b/modules/audio_coding/main/test/target_delay_unittest.cc
index 0ae2529..00806d9 100644
--- a/modules/audio_coding/main/test/target_delay_unittest.cc
+++ b/modules/audio_coding/main/test/target_delay_unittest.cc
@@ -14,6 +14,7 @@
 #include "webrtc/modules/audio_coding/main/interface/audio_coding_module.h"
 #include "webrtc/modules/interface/module_common_types.h"
 #include "webrtc/system_wrappers/interface/sleep.h"
+#include "webrtc/test/testsupport/gtest_disable.h"
 
 namespace webrtc {
 class TargetDelayTest : public ::testing::Test {
@@ -107,12 +108,12 @@
   WebRtcRTPHeader rtp_info_;
 };
 
-TEST_F(TargetDelayTest, OutOfRangeInput) {
+TEST_F(TargetDelayTest, DISABLED_ON_ANDROID(OutOfRangeInput)) {
   EXPECT_EQ(-1, SetMinimumDelay(-1));
   EXPECT_EQ(-1, SetMinimumDelay(10001));
 }
 
-TEST_F(TargetDelayTest, NoTargetDelayBufferSizeChanges) {
+TEST_F(TargetDelayTest, DISABLED_ON_ANDROID(NoTargetDelayBufferSizeChanges)) {
   for (int n = 0; n < 30; ++n)  // Run enough iterations.
     Run(true);
   int clean_optimal_delay = GetCurrentOptimalDelayMs();
@@ -124,7 +125,7 @@
   EXPECT_NEAR(required_delay, jittery_optimal_delay, 1);
 }
 
-TEST_F(TargetDelayTest, WithTargetDelayBufferNotChanging) {
+TEST_F(TargetDelayTest, DISABLED_ON_ANDROID(WithTargetDelayBufferNotChanging)) {
   // A target delay that is one packet larger than jitter.
   const int kTargetDelayMs = (kInterarrivalJitterPacket + 1) *
       kNum10msPerFrame * 10;
@@ -138,7 +139,7 @@
   EXPECT_EQ(jittery_optimal_delay, clean_optimal_delay);
 }
 
-TEST_F(TargetDelayTest, RequiredDelayAtCorrectRange) {
+TEST_F(TargetDelayTest, DISABLED_ON_ANDROID(RequiredDelayAtCorrectRange)) {
   for (int n = 0; n < 30; ++n)  // Run clean and store delay.
     Run(true);
   int clean_optimal_delay = GetCurrentOptimalDelayMs();
diff --git a/modules/audio_coding/neteq/neteq.gypi b/modules/audio_coding/neteq/neteq.gypi
index 63bcf72..9a460c4 100644
--- a/modules/audio_coding/neteq/neteq.gypi
+++ b/modules/audio_coding/neteq/neteq.gypi
@@ -89,7 +89,7 @@
       'targets': [
         {
           'target_name': 'neteq_unittests',
-          'type': 'executable',
+          'type': '<(gtest_target_type)',
           'dependencies': [
             'NetEq',
             'NetEqTestTools',
@@ -104,6 +104,15 @@
           'msvs_disabled_warnings': [
             4267,  # size_t to int truncation.
           ],
+          'conditions': [
+            # TODO(henrike): remove build_with_chromium==1 when the bots are
+            # using Chromium's buildbots.
+            ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+              'dependencies': [
+                '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
+              ],
+            }],
+          ],
         }, # neteq_unittests
         {
           'target_name': 'NetEqRTPplay',
@@ -208,6 +217,21 @@
           ],
         },
       ], # targets
+      'conditions': [
+        # TODO(henrike): remove build_with_chromium==1 when the bots are using
+        # Chromium's buildbots.
+        ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+          'targets': [
+            {
+              'target_name': 'neteq_unittests_apk_target',
+              'type': 'none',
+              'dependencies': [
+                '<(apk_tests_path):neteq_unittests_apk',
+              ],
+            },
+          ],
+        }],
+      ],
     }], # include_tests
   ], # conditions
 }
diff --git a/modules/audio_coding/neteq/webrtc_neteq_unittest.cc b/modules/audio_coding/neteq/webrtc_neteq_unittest.cc
index 9701261..0f92c35 100644
--- a/modules/audio_coding/neteq/webrtc_neteq_unittest.cc
+++ b/modules/audio_coding/neteq/webrtc_neteq_unittest.cc
@@ -375,7 +375,7 @@
   *payload_len = 1;  // Only noise level, no spectral parameters.
 }
 
-#if defined(_WIN32) && defined(WEBRTC_ARCH_64_BITS)
+#if (defined(_WIN32) && defined(WEBRTC_ARCH_64_BITS)) || defined(WEBRTC_ANDROID)
 // Disabled for Windows 64-bit until webrtc:1460 is fixed.
 #define MAYBE_TestBitExactness DISABLED_TestBitExactness
 #else
diff --git a/modules/audio_coding/neteq4/neteq.gypi b/modules/audio_coding/neteq4/neteq.gypi
index 68a2c13..ad6787c 100644
--- a/modules/audio_coding/neteq4/neteq.gypi
+++ b/modules/audio_coding/neteq4/neteq.gypi
@@ -124,7 +124,7 @@
       'targets': [
         {
           'target_name': 'audio_decoder_unittests',
-          'type': 'executable',
+          'type': '<(gtest_target_type)',
           'dependencies': [
             '<@(neteq_dependencies)',
             '<(DEPTH)/testing/gtest.gyp:gtest',
@@ -147,6 +147,15 @@
             'audio_decoder.cc',
             'interface/audio_decoder.h',
           ],
+          'conditions': [
+            # TODO(henrike): remove build_with_chromium==1 when the bots are
+            # using Chromium's buildbots.
+            ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+              'dependencies': [
+                '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
+              ],
+            }],
+          ],
           # Disable warnings to enable Win64 build, issue 1323.
           'msvs_disabled_warnings': [
             4267,  # size_t to int truncation.
@@ -181,6 +190,21 @@
           ],
         }, # neteq_unittest_tools
       ], # targets
+      'conditions': [
+        # TODO(henrike): remove build_with_chromium==1 when the bots are using
+        # Chromium's buildbots.
+        ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+          'targets': [
+            {
+              'target_name': 'audio_decoder_unittests_apk_target',
+              'type': 'none',
+              'dependencies': [
+                '<(apk_tests_path):audio_decoder_unittests_apk',
+              ],
+            },
+          ],
+        }],
+      ],
     }], # include_tests
   ], # conditions
 }
diff --git a/modules/modules.gyp b/modules/modules.gyp
index 168b88e..57cda36 100644
--- a/modules/modules.gyp
+++ b/modules/modules.gyp
@@ -259,9 +259,10 @@
         },
         {
           'target_name': 'modules_integrationtests',
-          'type': 'executable',
+          'type': '<(gtest_target_type)',
           'dependencies': [
             'audio_coding_module',
+            'media_file',
             'rtp_rtcp',
             'test_framework',
             'video_codecs_test_framework',
@@ -303,6 +304,15 @@
             'video_coding/codecs/test/videoprocessor_integrationtest.cc',
             'video_coding/codecs/vp8/test/vp8_impl_unittest.cc',
           ],
+          'conditions': [
+            # TODO(henrike): remove build_with_chromium==1 when the bots are
+            # using Chromium's buildbots.
+            ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+              'dependencies': [
+                '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
+              ],
+            }],
+          ],
         },
       ],
       'conditions': [
@@ -319,7 +329,22 @@
             }
           ],
         }],
-      ]
+      ],
+      'conditions': [
+        # TODO(henrike): remove build_with_chromium==1 when the bots are using
+        # Chromium's buildbots.
+        ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+          'targets': [
+            {
+              'target_name': 'modules_integrationtests_apk_target',
+              'type': 'none',
+              'dependencies': [
+                '<(apk_tests_path):modules_integrationtests_apk',
+              ],
+            },
+          ],
+        }],
+      ],
     }], # include_tests
   ], # conditions
 }
diff --git a/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc b/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc
index ca27b42..c24f8f6 100644
--- a/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc
+++ b/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc
@@ -21,6 +21,7 @@
 #include "webrtc/test/testsupport/fileutils.h"
 #include "webrtc/test/testsupport/frame_reader.h"
 #include "webrtc/test/testsupport/frame_writer.h"
+#include "webrtc/test/testsupport/gtest_disable.h"
 #include "webrtc/test/testsupport/metrics/video_metrics.h"
 #include "webrtc/test/testsupport/packet_reader.h"
 #include "webrtc/typedefs.h"
@@ -557,7 +558,8 @@
 // Run with no packet loss and fixed bitrate. Quality should be very high.
 // One key frame (first frame only) in sequence. Setting |key_frame_interval|
 // to -1 below means no periodic key frames in test.
-TEST_F(VideoProcessorIntegrationTest, ProcessZeroPacketLoss) {
+TEST_F(VideoProcessorIntegrationTest,
+       DISABLED_ON_ANDROID(ProcessZeroPacketLoss)) {
   // Bitrate and frame rate profile.
   RateProfile rate_profile;
   SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
@@ -580,7 +582,8 @@
 
 // Run with 5% packet loss and fixed bitrate. Quality should be a bit lower.
 // One key frame (first frame only) in sequence.
-TEST_F(VideoProcessorIntegrationTest, Process5PercentPacketLoss) {
+TEST_F(VideoProcessorIntegrationTest,
+       DISABLED_ON_ANDROID(Process5PercentPacketLoss)) {
   // Bitrate and frame rate profile.
   RateProfile rate_profile;
   SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
@@ -603,7 +606,8 @@
 
 // Run with 10% packet loss and fixed bitrate. Quality should be even lower.
 // One key frame (first frame only) in sequence.
-TEST_F(VideoProcessorIntegrationTest, Process10PercentPacketLoss) {
+TEST_F(VideoProcessorIntegrationTest,
+       DISABLED_ON_ANDROID(Process10PercentPacketLoss)) {
   // Bitrate and frame rate profile.
   RateProfile rate_profile;
   SetRateProfilePars(&rate_profile, 0, 500, 30, 0);
@@ -628,7 +632,8 @@
 // low to high to medium. Check that quality and encoder response to the new
 // target rate/per-frame bandwidth (for each rate update) is within limits.
 // One key frame (first frame only) in sequence.
-TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeBitRate) {
+TEST_F(VideoProcessorIntegrationTest,
+       DISABLED_ON_ANDROID(ProcessNoLossChangeBitRate)) {
   // Bitrate and frame rate profile.
   RateProfile rate_profile;
   SetRateProfilePars(&rate_profile, 0, 200, 30, 0);
@@ -660,7 +665,8 @@
 // for the rate control metrics can be lower. One key frame (first frame only).
 // Note: quality after update should be higher but we currently compute quality
 // metrics avergaed over whole sequence run.
-TEST_F(VideoProcessorIntegrationTest, ProcessNoLossChangeFrameRateFrameDrop) {
+TEST_F(VideoProcessorIntegrationTest,
+       DISABLED_ON_ANDROID(ProcessNoLossChangeFrameRateFrameDrop)) {
   config_.networking_config.packet_loss_probability = 0;
   // Bitrate and frame rate profile.
   RateProfile rate_profile;
@@ -692,7 +698,8 @@
 // spatial resize down at first key frame, and back up at second key frame.
 // Error_concealment is off in this test since there is a memory leak with
 // resizing and error concealment.
-TEST_F(VideoProcessorIntegrationTest, ProcessNoLossSpatialResizeFrameDrop) {
+TEST_F(VideoProcessorIntegrationTest,
+       DISABLED_ON_ANDROID(ProcessNoLossSpatialResizeFrameDrop)) {
   config_.networking_config.packet_loss_probability = 0;
   // Bitrate and frame rate profile.
   RateProfile rate_profile;
@@ -724,7 +731,8 @@
 // encoding rate mismatch are applied to each layer.
 // No dropped frames in this test, and internal spatial resizer is off.
 // One key frame (first frame only) in sequence, so no spatial resizing.
-TEST_F(VideoProcessorIntegrationTest, ProcessNoLossTemporalLayers) {
+TEST_F(VideoProcessorIntegrationTest,
+       DISABLED_ON_ANDROID(ProcessNoLossTemporalLayers)) {
   config_.networking_config.packet_loss_probability = 0;
   // Bitrate and frame rate profile.
   RateProfile rate_profile;
diff --git a/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc b/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc
index dd3d617..4a1a2ca 100644
--- a/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc
+++ b/modules/video_coding/codecs/vp8/test/vp8_impl_unittest.cc
@@ -15,6 +15,7 @@
 #include "webrtc/system_wrappers/interface/scoped_ptr.h"
 #include "webrtc/system_wrappers/interface/tick_util.h"
 #include "webrtc/test/testsupport/fileutils.h"
+#include "webrtc/test/testsupport/gtest_disable.h"
 
 namespace webrtc {
 
@@ -150,7 +151,7 @@
   VideoCodec codec_inst_;
 };
 
-TEST_F(TestVp8Impl, BaseUnitTest) {
+TEST_F(TestVp8Impl, DISABLED_ON_ANDROID(BaseUnitTest)) {
   // TODO(mikhal): Remove dependency. Move all test code here.
   EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, encoder_->Release());
   UnitTest unittest;
@@ -188,7 +189,7 @@
   EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK, decoder_->InitDecode(&codec_inst_, 1));
 }
 
-TEST_F(TestVp8Impl, AlignedStrideEncodeDecode) {
+TEST_F(TestVp8Impl, DISABLED_ON_ANDROID(AlignedStrideEncodeDecode)) {
   // Using a QCIF image (aligned stride (u,v planse) > width).
   // Processing only one frame.
   const VideoSource source(test::ResourcePath("paris_qcif", "yuv"), kQCIF);
diff --git a/system_wrappers/source/system_wrappers_tests.gyp b/system_wrappers/source/system_wrappers_tests.gyp
index 8dc14b6..e34856f 100644
--- a/system_wrappers/source/system_wrappers_tests.gyp
+++ b/system_wrappers/source/system_wrappers_tests.gyp
@@ -11,7 +11,7 @@
   'targets': [
     {
       'target_name': 'system_wrappers_unittests',
-      'type': 'executable',
+      'type': '<(gtest_target_type)',
       'dependencies': [
         '<(DEPTH)/testing/gtest.gyp:gtest',
         '<(webrtc_root)/system_wrappers/source/system_wrappers.gyp:system_wrappers',
@@ -46,6 +46,13 @@
         ['os_posix==0', {
           'sources!': [ 'thread_posix_unittest.cc', ],
         }],
+        # TODO(henrike): remove build_with_chromium==1 when the bots are
+        # using Chromium's buildbots.
+        ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+          'dependencies': [
+            '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
+          ],
+        }],
       ],
       # Disable warnings to enable Win64 build, issue 1323.
       'msvs_disabled_warnings': [
@@ -53,5 +60,20 @@
       ],
     },
   ],
+  'conditions': [
+    # TODO(henrike): remove build_with_chromium==1 when the bots are using
+    # Chromium's buildbots.
+    ['include_tests==1 and build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+      'targets': [
+        {
+          'target_name': 'system_wrappers_unittests_apk_target',
+          'type': 'none',
+          'dependencies': [
+            '<(apk_tests_path):system_wrappers_unittests_apk',
+          ],
+        },
+      ],
+    }],
+  ],
 }
 
diff --git a/test/metrics.gyp b/test/metrics.gyp
index 17d9877..0f0774a 100644
--- a/test/metrics.gyp
+++ b/test/metrics.gyp
@@ -33,7 +33,7 @@
     },
     {
       'target_name': 'metrics_unittests',
-      'type': 'executable',
+      'type': '<(gtest_target_type)',
       'dependencies': [
         'metrics',
         '<(webrtc_root)/test/test.gyp:test_support_main',
@@ -42,6 +42,30 @@
       'sources': [
         'testsupport/metrics/video_metrics_unittest.cc',
       ],
+      'conditions': [
+        # TODO(henrike): remove build_with_chromium==1 when the bots are
+        # using Chromium's buildbots.
+        ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+          'dependencies': [
+            '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
+          ],
+        }],
+      ],
     },
   ],
+  'conditions': [
+    # TODO(henrike): remove build_with_chromium==1 when the bots are using
+    # Chromium's buildbots.
+    ['include_tests==1 and build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+      'targets': [
+        {
+          'target_name': 'metrics_unittests_apk_target',
+          'type': 'none',
+          'dependencies': [
+            '<(apk_tests_path):metrics_unittests_apk',
+          ],
+        },
+      ],
+    }],
+  ],
 }
diff --git a/test/test.gyp b/test/test.gyp
index dd71ee0..c0340de 100644
--- a/test/test.gyp
+++ b/test/test.gyp
@@ -144,7 +144,7 @@
     },
     {
       'target_name': 'test_support_unittests',
-      'type': 'executable',
+      'type': '<(gtest_target_type)',
       'dependencies': [
         'channel_transport',
         'test_support_main',
@@ -166,6 +166,15 @@
       'msvs_disabled_warnings': [
         4267,  # size_t to int truncation.
       ],
+      'conditions': [
+        # TODO(henrike): remove build_with_chromium==1 when the bots are
+        # using Chromium's buildbots.
+        ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+          'dependencies': [
+            '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
+          ],
+        }],
+      ],
     },
     {
       'target_name': 'buildbot_tests_scripts',
@@ -188,4 +197,19 @@
       ],
     },  # target buildbot_tests_scripts
   ],
+  'conditions': [
+    # TODO(henrike): remove build_with_chromium==1 when the bots are using
+    # Chromium's buildbots.
+    ['include_tests==1 and build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+      'targets': [
+        {
+          'target_name': 'test_support_unittests_apk_target',
+          'type': 'none',
+          'dependencies': [
+            '<(apk_tests_path):test_support_unittests_apk',
+          ],
+        },
+      ],
+    }],
+  ],
 }
diff --git a/test/testsupport/fileutils_unittest.cc b/test/testsupport/fileutils_unittest.cc
index 1eb8aa0..1fd11bf 100644
--- a/test/testsupport/fileutils_unittest.cc
+++ b/test/testsupport/fileutils_unittest.cc
@@ -15,6 +15,7 @@
 #include <string>
 
 #include "testing/gtest/include/gtest/gtest.h"
+#include "webrtc/test/testsupport/gtest_disable.h"
 
 #ifdef WIN32
 #define chdir _chdir
@@ -110,7 +111,7 @@
 
 // Tests with current working directory set to a directory higher up in the
 // directory tree than the project root dir.
-TEST_F(FileUtilsTest, OutputPathFromRootWorkingDir) {
+TEST_F(FileUtilsTest, DISABLED_ON_ANDROID(OutputPathFromRootWorkingDir)) {
   ASSERT_EQ(0, chdir(kPathDelimiter));
   ASSERT_EQ("./", webrtc::test::OutputPath());
 }
diff --git a/test/testsupport/metrics/video_metrics_unittest.cc b/test/testsupport/metrics/video_metrics_unittest.cc
index 7e3a4e6..c825f9e 100644
--- a/test/testsupport/metrics/video_metrics_unittest.cc
+++ b/test/testsupport/metrics/video_metrics_unittest.cc
@@ -12,6 +12,7 @@
 
 #include "testing/gtest/include/gtest/gtest.h"
 #include "webrtc/test/testsupport/fileutils.h"
+#include "webrtc/test/testsupport/gtest_disable.h"
 
 namespace webrtc {
 
@@ -46,19 +47,22 @@
 };
 
 // Tests that it is possible to run with the same reference as test file
-TEST_F(VideoMetricsTest, ReturnsPerfectResultForIdenticalFilesPSNR) {
+TEST_F(VideoMetricsTest,
+       DISABLED_ON_ANDROID(ReturnsPerfectResultForIdenticalFilesPSNR)) {
   EXPECT_EQ(0, I420PSNRFromFiles(video_file_.c_str(), video_file_.c_str(),
                                  kWidth, kHeight, &psnr_result_));
   EXPECT_EQ(kPsnrPerfectResult, psnr_result_.average);
 }
 
-TEST_F(VideoMetricsTest, ReturnsPerfectResultForIdenticalFilesSSIM) {
+TEST_F(VideoMetricsTest,
+       DISABLED_ON_ANDROID(ReturnsPerfectResultForIdenticalFilesSSIM)) {
   EXPECT_EQ(0, I420SSIMFromFiles(video_file_.c_str(), video_file_.c_str(),
                                  kWidth, kHeight, &ssim_result_));
   EXPECT_EQ(kSsimPerfectResult, ssim_result_.average);
 }
 
-TEST_F(VideoMetricsTest, ReturnsPerfectResultForIdenticalFilesBothMetrics) {
+TEST_F(VideoMetricsTest,
+       DISABLED_ON_ANDROID(ReturnsPerfectResultForIdenticalFilesBothMetrics)) {
   EXPECT_EQ(0, I420MetricsFromFiles(video_file_.c_str(), video_file_.c_str(),
                                     kWidth, kHeight, &psnr_result_,
                                     &ssim_result_));
@@ -67,19 +71,19 @@
 }
 
 // Tests that the right return code is given when the reference file is missing.
-TEST_F(VideoMetricsTest, MissingReferenceFilePSNR) {
+TEST_F(VideoMetricsTest, DISABLED_ON_ANDROID(MissingReferenceFilePSNR)) {
   EXPECT_EQ(kMissingReferenceFileReturnCode,
             I420PSNRFromFiles(kNonExistingFileName, video_file_.c_str(),
                               kWidth, kHeight, &ssim_result_));
 }
 
-TEST_F(VideoMetricsTest, MissingReferenceFileSSIM) {
+TEST_F(VideoMetricsTest, DISABLED_ON_ANDROID(MissingReferenceFileSSIM)) {
   EXPECT_EQ(kMissingReferenceFileReturnCode,
             I420SSIMFromFiles(kNonExistingFileName, video_file_.c_str(),
                               kWidth, kHeight, &ssim_result_));
 }
 
-TEST_F(VideoMetricsTest, MissingReferenceFileBothMetrics) {
+TEST_F(VideoMetricsTest, DISABLED_ON_ANDROID(MissingReferenceFileBothMetrics)) {
   EXPECT_EQ(kMissingReferenceFileReturnCode,
             I420MetricsFromFiles(kNonExistingFileName, video_file_.c_str(),
                                  kWidth, kHeight,
@@ -87,19 +91,19 @@
 }
 
 // Tests that the right return code is given when the test file is missing.
-TEST_F(VideoMetricsTest, MissingTestFilePSNR) {
+TEST_F(VideoMetricsTest, DISABLED_ON_ANDROID(MissingTestFilePSNR)) {
   EXPECT_EQ(kMissingTestFileReturnCode,
             I420PSNRFromFiles(video_file_.c_str(), kNonExistingFileName,
                               kWidth, kHeight, &ssim_result_));
 }
 
-TEST_F(VideoMetricsTest, MissingTestFileSSIM) {
+TEST_F(VideoMetricsTest, DISABLED_ON_ANDROID(MissingTestFileSSIM)) {
   EXPECT_EQ(kMissingTestFileReturnCode,
             I420SSIMFromFiles(video_file_.c_str(), kNonExistingFileName,
                               kWidth, kHeight, &ssim_result_));
 }
 
-TEST_F(VideoMetricsTest, MissingTestFileBothMetrics) {
+TEST_F(VideoMetricsTest, DISABLED_ON_ANDROID(MissingTestFileBothMetrics)) {
   EXPECT_EQ(kMissingTestFileReturnCode,
             I420MetricsFromFiles(video_file_.c_str(), kNonExistingFileName,
                                  kWidth, kHeight,
@@ -107,7 +111,7 @@
 }
 
 // Tests that the method can be executed with empty files.
-TEST_F(VideoMetricsTest, EmptyFilesPSNR) {
+TEST_F(VideoMetricsTest, DISABLED_ON_ANDROID(EmptyFilesPSNR)) {
   EXPECT_EQ(kEmptyFileReturnCode,
             I420PSNRFromFiles(kEmptyFileName, video_file_.c_str(),
                               kWidth, kHeight, &ssim_result_));
@@ -116,7 +120,7 @@
                               kWidth, kHeight, &ssim_result_));
 }
 
-TEST_F(VideoMetricsTest, EmptyFilesSSIM) {
+TEST_F(VideoMetricsTest, DISABLED_ON_ANDROID(EmptyFilesSSIM)) {
   EXPECT_EQ(kEmptyFileReturnCode,
             I420SSIMFromFiles(kEmptyFileName, video_file_.c_str(),
                               kWidth, kHeight, &ssim_result_));
@@ -125,7 +129,7 @@
                               kWidth, kHeight, &ssim_result_));
 }
 
-TEST_F(VideoMetricsTest, EmptyFilesBothMetrics) {
+TEST_F(VideoMetricsTest, DISABLED_ON_ANDROID(EmptyFilesBothMetrics)) {
   EXPECT_EQ(kEmptyFileReturnCode,
             I420MetricsFromFiles(kEmptyFileName, video_file_.c_str(),
                                  kWidth, kHeight,
diff --git a/tools/tools.gyp b/tools/tools.gyp
index 1954d1c..b7e6ac0 100644
--- a/tools/tools.gyp
+++ b/tools/tools.gyp
@@ -110,7 +110,7 @@
       'targets' : [
         {
           'target_name': 'tools_unittests',
-          'type': 'executable',
+          'type': '<(gtest_target_type)',
           'dependencies': [
             'frame_editing_lib',
             '<(webrtc_root)/tools/internal_tools.gyp:command_line_parser',
@@ -125,8 +125,32 @@
           'msvs_disabled_warnings': [
             4267,  # size_t to int truncation.
           ],
+          'conditions': [
+            # TODO(henrike): remove build_with_chromium==1 when the bots are
+            # using Chromium's buildbots.
+            ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+              'dependencies': [
+                '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
+              ],
+            }],
+          ],
         }, # tools_unittests
       ], # targets
+      # TODO(henrike): remove build_with_chromium==1 when the bots are using
+      # Chromium's buildbots.
+      'conditions': [
+        ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+          'targets': [
+            {
+              'target_name': 'tools_unittests_apk_target',
+              'type': 'none',
+              'dependencies': [
+                '<(apk_tests_path):tools_unittests_apk',
+              ],
+            },
+          ],
+        }],
+      ],
     }], # include_tests
   ], # conditions
 }
diff --git a/video_engine/video_engine_core.gypi b/video_engine/video_engine_core.gypi
index 629f0a2..779bbc6 100644
--- a/video_engine/video_engine_core.gypi
+++ b/video_engine/video_engine_core.gypi
@@ -139,7 +139,7 @@
       'targets': [
         {
           'target_name': 'video_engine_core_unittests',
-          'type': 'executable',
+          'type': '<(gtest_target_type)',
           'dependencies': [
             'video_engine_core',
             '<(DEPTH)/testing/gtest.gyp:gtest',
@@ -158,8 +158,32 @@
             'stream_synchronization_unittest.cc',
             'vie_remb_unittest.cc',
           ],
+          'conditions': [
+            # TODO(henrike): remove build_with_chromium==1 when the bots are
+            # using Chromium's buildbots.
+            ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+              'dependencies': [
+                '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
+              ],
+            }],
+          ],
         },
       ], # targets
+      'conditions': [
+        # TODO(henrike): remove build_with_chromium==1 when the bots are using
+        # Chromium's buildbots.
+        ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+          'targets': [
+            {
+              'target_name': 'video_engine_core_unittests_apk_target',
+              'type': 'none',
+              'dependencies': [
+                '<(apk_tests_path):video_engine_core_unittests_apk',
+              ],
+            },
+          ],
+        }],
+      ],
     }], # include_tests
   ], # conditions
 }
diff --git a/voice_engine/voe_codec_unittest.cc b/voice_engine/voe_codec_unittest.cc
index a0531f1..baa4f37 100644
--- a/voice_engine/voe_codec_unittest.cc
+++ b/voice_engine/voe_codec_unittest.cc
@@ -13,6 +13,7 @@
 #include "testing/gtest/include/gtest/gtest.h"
 #include "webrtc/modules/audio_device/include/fake_audio_device.h"
 #include "webrtc/system_wrappers/interface/scoped_ptr.h"
+#include "webrtc/test/testsupport/gtest_disable.h"
 #include "webrtc/voice_engine/include/voe_base.h"
 #include "webrtc/voice_engine/include/voe_hardware.h"
 #include "webrtc/voice_engine/voice_engine_defines.h"
@@ -101,14 +102,16 @@
 };
 
 
-TEST_F(VoECodecTest, DualStreamSetSecondaryBeforePrimaryFails) {
+TEST_F(VoECodecTest,
+       DISABLED_ON_ANDROID(DualStreamSetSecondaryBeforePrimaryFails)) {
   // Setting secondary before a primary is registered should fail.
   EXPECT_EQ(-1, voe_codec_->SetSecondarySendCodec(channel_, valid_secondary_,
                                                   red_payload_type_));
   red_payload_type_ = 1;
 }
 
-TEST_F(VoECodecTest, DualStreamRegisterWithWrongInputsFails) {
+TEST_F(VoECodecTest,
+       DISABLED_ON_ANDROID(DualStreamRegisterWithWrongInputsFails)) {
   // Register primary codec.
   EXPECT_EQ(0, voe_codec_->SetSendCodec(channel_, primary_));
 
@@ -125,7 +128,7 @@
                                                   red_payload_type_));
 }
 
-TEST_F(VoECodecTest, DualStreamGetSecodaryEncoder) {
+TEST_F(VoECodecTest, DISABLED_ON_ANDROID(DualStreamGetSecodaryEncoder)) {
   // Register primary codec.
   EXPECT_EQ(0, voe_codec_->SetSendCodec(channel_, primary_));
 
@@ -149,7 +152,7 @@
   EXPECT_EQ(0, STR_CASE_CMP(valid_secondary_.plname, my_codec.plname));
 }
 
-TEST_F(VoECodecTest, DualStreamRemoveSecondaryCodec) {
+TEST_F(VoECodecTest, DISABLED_ON_ANDROID(DualStreamRemoveSecondaryCodec)) {
   // Register primary codec.
   EXPECT_EQ(0, voe_codec_->SetSendCodec(channel_, primary_));
 
diff --git a/voice_engine/voice_engine.gyp b/voice_engine/voice_engine.gyp
index 65e6b8c..c20a3fc 100644
--- a/voice_engine/voice_engine.gyp
+++ b/voice_engine/voice_engine.gyp
@@ -121,7 +121,7 @@
       'targets': [
         {
           'target_name': 'voice_engine_unittests',
-          'type': 'executable',
+          'type': '<(gtest_target_type)',
           'dependencies': [
             'voice_engine',
             '<(DEPTH)/testing/gtest.gyp:gtest',
@@ -149,6 +149,15 @@
             'voe_base_unittest.cc',
             'voe_codec_unittest.cc',
           ],
+          'conditions': [
+            # TODO(henrike): remove build_with_chromium==1 when the bots are
+            # using Chromium's buildbots.
+            ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+              'dependencies': [
+                '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
+              ],
+            }],
+          ],
         },
         {
           'target_name': 'voe_auto_test',
@@ -300,6 +309,19 @@
             },
           ],  # targets
         }],
+        # TODO(henrike): remove build_with_chromium==1 when the bots are using
+        # Chromium's buildbots.
+        ['build_with_chromium==1 and OS=="android" and gtest_target_type=="shared_library"', {
+          'targets': [
+            {
+              'target_name': 'voice_engine_unittests_apk_target',
+              'type': 'none',
+              'dependencies': [
+                '<(apk_tests_path):voice_engine_unittests_apk',
+              ],
+            },
+          ],
+        }],
       ],  # conditions
     }], # include_tests
   ], # conditions