Enable more unittests on iOS, and disable those that fail on simulator

Tests enabled:
* modules_unittests
* ortc_unittests
* rtc_media_unittests
* rtc_unittests
* video_capture_tests
* video_engine_tests

BUG=webrtc:5566,webrtc:4752,webrtc:5568,webrtc:5569

Review-Url: https://codereview.webrtc.org/2938193002
Cr-Commit-Position: refs/heads/master@{#18710}
This commit is contained in:
oprypin
2017-06-22 01:47:20 -07:00
committed by Commit Bot
parent ab97e18fa9
commit 451975206a
7 changed files with 68 additions and 13 deletions

View File

@ -16,12 +16,24 @@
{ {
"app": "modules_tests" "app": "modules_tests"
}, },
{
"app": "modules_unittests"
},
{
"app": "ortc_unittests"
},
{
"app": "rtc_media_unittests"
},
{ {
"app": "rtc_pc_unittests" "app": "rtc_pc_unittests"
}, },
{ {
"app": "rtc_stats_unittests" "app": "rtc_stats_unittests"
}, },
{
"app": "rtc_unittests"
},
{ {
"app": "system_wrappers_unittests" "app": "system_wrappers_unittests"
}, },
@ -31,6 +43,12 @@
{ {
"app": "tools_unittests" "app": "tools_unittests"
}, },
{
"app": "video_capture_tests"
},
{
"app": "video_engine_tests"
},
{ {
"app": "voice_engine_unittests" "app": "voice_engine_unittests"
}, },

View File

@ -443,9 +443,14 @@ if (rtc_include_tests) {
"engine/webrtcvideocapturer_unittest.cc", "engine/webrtcvideocapturer_unittest.cc",
"engine/webrtcvideoencoderfactory_unittest.cc", "engine/webrtcvideoencoderfactory_unittest.cc",
"engine/webrtcvideoengine_unittest.cc", "engine/webrtcvideoengine_unittest.cc",
"engine/webrtcvoiceengine_unittest.cc",
] ]
# TODO(kthelgason): Reenable this test on iOS.
# See bugs.webrtc.org/5569
if (!is_ios) {
sources += [ "engine/webrtcvoiceengine_unittest.cc" ]
}
if (rtc_enable_sctp) { if (rtc_enable_sctp) {
sources += [ "sctp/sctptransport_unittest.cc" ] sources += [ "sctp/sctptransport_unittest.cc" ]
} }

View File

@ -110,7 +110,10 @@ TEST(ApmHelpersTest, AgcConfig_GetAndSet) {
TEST(ApmHelpersTest, AgcStatus_DefaultMode) { TEST(ApmHelpersTest, AgcStatus_DefaultMode) {
TestHelper helper; TestHelper helper;
GainControl* gc = helper.apm()->gain_control(); GainControl* gc = helper.apm()->gain_control();
#if defined(WEBRTC_IOS) || defined(WEBRTC_ANDROID) #if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
EXPECT_FALSE(gc->is_enabled());
EXPECT_EQ(GainControl::kAdaptiveDigital, gc->mode());
#elif defined(WEBRTC_IOS) || defined(WEBRTC_ANDROID)
EXPECT_FALSE(gc->is_enabled()); EXPECT_FALSE(gc->is_enabled());
EXPECT_EQ(GainControl::kFixedDigital, gc->mode()); EXPECT_EQ(GainControl::kFixedDigital, gc->mode());
#else #else
@ -249,7 +252,14 @@ TEST(ApmHelpersTest, TypingDetectionStatus_DefaultMode) {
EXPECT_FALSE(vd->is_enabled()); EXPECT_FALSE(vd->is_enabled());
} }
TEST(ApmHelpersTest, TypingDetectionStatus_EnableDisable) { // TODO(kthelgason): Reenable this test on simulator.
// See bugs.webrtc.org/5569
#if defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
#define MAYBE_TypingDetectionStatus_EnableDisable DISABLED_TypingDetectionStatus_EnableDisable
#else
#define MAYBE_TypingDetectionStatus_EnableDisable TypingDetectionStatus_EnableDisable
#endif
TEST(ApmHelpersTest, MAYBE_TypingDetectionStatus_EnableDisable) {
TestHelper helper; TestHelper helper;
VoiceDetection* vd = helper.apm()->voice_detection(); VoiceDetection* vd = helper.apm()->voice_detection();
apm_helpers::SetTypingDetectionStatus(helper.apm(), true); apm_helpers::SetTypingDetectionStatus(helper.apm(), true);

View File

@ -307,7 +307,9 @@ if (rtc_include_tests) {
"//webrtc/sdk/android:libjingle_peerconnection_java", "//webrtc/sdk/android:libjingle_peerconnection_java",
] ]
} }
if (is_ios) { if (is_ios && !use_ios_simulator) {
# TODO(kthelgason): Reenable these tests on simulator.
# See bugs.webrtc.org/7812
sources += [ "ios/audio_device_unittest_ios.mm" ] sources += [ "ios/audio_device_unittest_ios.mm" ]
deps += [ "//third_party/ocmock" ] deps += [ "//third_party/ocmock" ]
} }

View File

@ -9,6 +9,7 @@
import("../webrtc.gni") import("../webrtc.gni")
if (is_ios) { if (is_ios) {
import("//build/config/ios/rules.gni") import("//build/config/ios/rules.gni")
import("//build/config/ios/ios_sdk.gni")
} }
declare_args() { declare_args() {
@ -366,7 +367,6 @@ if (is_ios || is_mac) {
visibility = [ "..:rtc_unittests" ] visibility = [ "..:rtc_unittests" ]
} }
sources = [ sources = [
"objc/Framework/UnitTests/RTCCameraVideoCapturerTests.mm",
"objc/Framework/UnitTests/RTCConfigurationTest.mm", "objc/Framework/UnitTests/RTCConfigurationTest.mm",
"objc/Framework/UnitTests/RTCDataChannelConfigurationTest.mm", "objc/Framework/UnitTests/RTCDataChannelConfigurationTest.mm",
"objc/Framework/UnitTests/RTCIceCandidateTest.mm", "objc/Framework/UnitTests/RTCIceCandidateTest.mm",
@ -376,6 +376,13 @@ if (is_ios || is_mac) {
"objc/Framework/UnitTests/RTCSessionDescriptionTest.mm", "objc/Framework/UnitTests/RTCSessionDescriptionTest.mm",
"objc/Framework/UnitTests/avformatmappertests.mm", "objc/Framework/UnitTests/avformatmappertests.mm",
] ]
if (is_ios &&
!(use_ios_simulator &&
# The tests crash on these simulator versions:
(ios_sdk_version == "10.0" || ios_sdk_version == "10.1"))) {
sources +=
[ "objc/Framework/UnitTests/RTCCameraVideoCapturerTests.mm" ]
}
# |-ObjC| flag needed to make sure category method implementations # |-ObjC| flag needed to make sure category method implementations
# are included: # are included:

View File

@ -217,42 +217,50 @@ CMSampleBufferRef createTestSampleBufferRef() {
@end @end
TEST(RTCCameraVideoCapturerTests, SetupSession) { // TODO(kthelgason): Reenable these tests on simulator.
// See bugs.webrtc.org/7813
#if TARGET_IPHONE_SIMULATOR
#define MAYBE_TEST(f, name) TEST(f, DISABLED_##name)
#else
#define MAYBE_TEST TEST
#endif
MAYBE_TEST(RTCCameraVideoCapturerTests, SetupSession) {
RTCCameraVideoCapturerTests *test = [[RTCCameraVideoCapturerTests alloc] init]; RTCCameraVideoCapturerTests *test = [[RTCCameraVideoCapturerTests alloc] init];
[test setup]; [test setup];
[test testSetupSession]; [test testSetupSession];
[test tearDown]; [test tearDown];
} }
TEST(RTCCameraVideoCapturerTests, SetupSessionOutput) { MAYBE_TEST(RTCCameraVideoCapturerTests, SetupSessionOutput) {
RTCCameraVideoCapturerTests *test = [[RTCCameraVideoCapturerTests alloc] init]; RTCCameraVideoCapturerTests *test = [[RTCCameraVideoCapturerTests alloc] init];
[test setup]; [test setup];
[test testSetupSessionOutput]; [test testSetupSessionOutput];
[test tearDown]; [test tearDown];
} }
TEST(RTCCameraVideoCapturerTests, SupportedFormatsForDevice) { MAYBE_TEST(RTCCameraVideoCapturerTests, SupportedFormatsForDevice) {
RTCCameraVideoCapturerTests *test = [[RTCCameraVideoCapturerTests alloc] init]; RTCCameraVideoCapturerTests *test = [[RTCCameraVideoCapturerTests alloc] init];
[test setup]; [test setup];
[test testSupportedFormatsForDevice]; [test testSupportedFormatsForDevice];
[test tearDown]; [test tearDown];
} }
TEST(RTCCameraVideoCapturerTests, CaptureDevices) { MAYBE_TEST(RTCCameraVideoCapturerTests, CaptureDevices) {
RTCCameraVideoCapturerTests *test = [[RTCCameraVideoCapturerTests alloc] init]; RTCCameraVideoCapturerTests *test = [[RTCCameraVideoCapturerTests alloc] init];
[test setup]; [test setup];
[test testCaptureDevices]; [test testCaptureDevices];
[test tearDown]; [test tearDown];
} }
TEST(RTCCameraVideoCapturerTests, DelegateCallbackNotCalledWhenInvalidBuffer) { MAYBE_TEST(RTCCameraVideoCapturerTests, DelegateCallbackNotCalledWhenInvalidBuffer) {
RTCCameraVideoCapturerTests *test = [[RTCCameraVideoCapturerTests alloc] init]; RTCCameraVideoCapturerTests *test = [[RTCCameraVideoCapturerTests alloc] init];
[test setup]; [test setup];
[test testDelegateCallbackNotCalledWhenInvalidBuffer]; [test testDelegateCallbackNotCalledWhenInvalidBuffer];
[test tearDown]; [test tearDown];
} }
TEST(RTCCameraVideoCapturerTests, DelegateCallbackWithValidBufferAndOrientationUpdate) { MAYBE_TEST(RTCCameraVideoCapturerTests, DelegateCallbackWithValidBufferAndOrientationUpdate) {
RTCCameraVideoCapturerTests *test = [[RTCCameraVideoCapturerTests alloc] init]; RTCCameraVideoCapturerTests *test = [[RTCCameraVideoCapturerTests alloc] init];
[test setup]; [test setup];
[test testDelegateCallbackWithValidBufferAndOrientationUpdate]; [test testDelegateCallbackWithValidBufferAndOrientationUpdate];

View File

@ -61,9 +61,11 @@
#include "webrtc/test/testsupport/perf_test.h" #include "webrtc/test/testsupport/perf_test.h"
#include "webrtc/video/transport_adapter.h" #include "webrtc/video/transport_adapter.h"
// Flaky under MemorySanitizer: bugs.webrtc.org/7419
#if defined(MEMORY_SANITIZER) #if defined(MEMORY_SANITIZER)
// Flaky under MemorySanitizer, see #define MAYBE_InitialProbing DISABLED_InitialProbing
// https://bugs.chromium.org/p/webrtc/issues/detail?id=7419 // Fails on iOS bots: bugs.webrtc.org/7851
#elif defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
#define MAYBE_InitialProbing DISABLED_InitialProbing #define MAYBE_InitialProbing DISABLED_InitialProbing
#else #else
#define MAYBE_InitialProbing InitialProbing #define MAYBE_InitialProbing InitialProbing
@ -2343,6 +2345,9 @@ TEST_F(EndToEndTest, MAYBE_InitialProbing) {
// Fails on Linux MSan: bugs.webrtc.org/7428 // Fails on Linux MSan: bugs.webrtc.org/7428
#if defined(MEMORY_SANITIZER) #if defined(MEMORY_SANITIZER)
TEST_F(EndToEndTest, DISABLED_TriggerMidCallProbing) { TEST_F(EndToEndTest, DISABLED_TriggerMidCallProbing) {
// Fails on iOS bots: bugs.webrtc.org/7851
#elif defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR
TEST_F(EndToEndTest, DISABLED_TriggerMidCallProbing) {
#else #else
TEST_F(EndToEndTest, TriggerMidCallProbing) { TEST_F(EndToEndTest, TriggerMidCallProbing) {
#endif #endif