Add ARDSettingsModelTests to apprtcmobile_test target.
Also extract all iOS sources into a static library configuration
so it's easier to include them in the test target as well.
Also, fix a wrong test that was undiscovered because the
tests were not running
BUG=webrtc:6707
Review-Url: https://codereview.webrtc.org/2502623002
Cr-Commit-Position: refs/heads/master@{#15076}
diff --git a/webrtc/examples/BUILD.gn b/webrtc/examples/BUILD.gn
index dc9e24e..58ae8a4 100644
--- a/webrtc/examples/BUILD.gn
+++ b/webrtc/examples/BUILD.gn
@@ -234,7 +234,7 @@
}
if (is_ios) {
- ios_app_bundle("AppRTCMobile") {
+ rtc_static_library("AppRTCMobile_lib") {
sources = [
"objc/AppRTCMobile/ios/ARDAppDelegate.m",
"objc/AppRTCMobile/ios/ARDMainView.h",
@@ -257,22 +257,31 @@
"objc/AppRTCMobile/ios/AppRTCMobile-Prefix.pch",
"objc/AppRTCMobile/ios/UIImage+ARDUtilities.h",
"objc/AppRTCMobile/ios/UIImage+ARDUtilities.m",
+ ]
+ configs += [
+ "//build/config/compiler:enable_arc",
+ ":warnings_config",
+ ]
+
+ deps = [
+ ":apprtc_common",
+ ":apprtc_signaling",
+ ]
+ }
+
+ ios_app_bundle("AppRTCMobile") {
+ sources = [
"objc/AppRTCMobile/ios/main.m",
]
info_plist = "objc/AppRTCMobile/ios/Info.plist"
- configs += [
- "..:common_config",
- "//build/config/compiler:enable_arc",
- ":warnings_config",
- ]
+ configs += [ "..:common_config" ]
public_configs = [ "..:common_inherited_config" ]
deps = [
":AppRTCMobile_ios_bundle_data",
- ":apprtc_common",
- ":apprtc_signaling",
+ ":AppRTCMobile_lib",
]
if (target_cpu == "x86") {
@@ -306,7 +315,7 @@
}
if (is_mac) {
- rtc_static_library("AppRTCMobile_app") {
+ rtc_static_library("AppRTCMobile_lib") {
sources = [
"objc/AppRTCMobile/mac/APPRTCAppDelegate.h",
"objc/AppRTCMobile/mac/APPRTCAppDelegate.m",
@@ -339,7 +348,7 @@
libs = [ "AppKit.framework" ]
deps = [
- ":AppRTCMobile_app",
+ ":AppRTCMobile_lib",
]
}
}
@@ -396,7 +405,9 @@
}
rtc_test("apprtcmobile_tests") {
+ include_dirs = [ "objc/AppRTCMobile/ios" ]
deps = [
+ ":AppRTCMobile_lib",
":apprtc_signaling",
"//testing/gtest",
"//third_party/ocmock",
@@ -404,6 +415,7 @@
sources = [
"objc/AppRTCMobile/tests/ARDAppClientTest.mm",
+ "objc/AppRTCMobile/tests/ARDSettingsModelTests.mm",
]
if (is_ios) {
diff --git a/webrtc/examples/objc/AppRTCMobile/tests/ARDSettingsModelTests.mm b/webrtc/examples/objc/AppRTCMobile/tests/ARDSettingsModelTests.mm
index 5be8b6b..4ceac81 100644
--- a/webrtc/examples/objc/AppRTCMobile/tests/ARDSettingsModelTests.mm
+++ b/webrtc/examples/objc/AppRTCMobile/tests/ARDSettingsModelTests.mm
@@ -69,7 +69,7 @@
BOOL result = [_model storeVideoResoultionConstraint:@"960x480"];
// then
- EXPECT_TRUE(result);
+ EXPECT_FALSE(result);
}
- (void)testWidthConstraintFromStore {