Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Unified Diff: webrtc/examples/objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm

Issue 2778163005: Use new RTCCameraVideoCapturer in AppRTCMobile. (Closed)
Patch Set: Remove localCapturer property from ARDVideoCallViewController. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/examples/objc/AppRTCMobile/mac/APPRTCViewController.m ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/examples/objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm
diff --git a/webrtc/examples/objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm b/webrtc/examples/objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm
index eee18db69c4cfb4dc6780ab2ad0b9b8d89aa39e1..64e05b195d4bc21ec0903ffa47453b1c7ceb3139 100644
--- a/webrtc/examples/objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm
+++ b/webrtc/examples/objc/AppRTCMobile/tests/ARDSettingsModel_xctest.mm
@@ -25,9 +25,9 @@
@implementation ARDSettingsModelTests
-- (id)setupMockStoreWithMediaConstraintString:(NSString *)constraintString {
+- (id)setupMockStoreWithVideoResolution:(NSString *)videoResolution {
id storeMock = [OCMockObject mockForClass:[ARDSettingsStore class]];
- [([[storeMock stub] andReturn:constraintString]) videoResolutionConstraints];
+ [([[storeMock stub] andReturn:videoResolution])videoResolution];
id partialMock = [OCMockObject partialMockForObject:_model];
[[[partialMock stub] andReturn:storeMock] settingsStore];
@@ -40,45 +40,38 @@
}
- (void)testDefaultMediaFromStore {
- id storeMock = [self setupMockStoreWithMediaConstraintString:nil];
- [[storeMock expect] setVideoResolutionConstraints:@"640x480"];
+ id storeMock = [self setupMockStoreWithVideoResolution:nil];
+ [[storeMock expect] setVideoResolution:@"640x480"];
- NSString *string = [_model currentVideoResoultionConstraintFromStore];
+ NSString *string = [_model currentVideoResolutionSettingFromStore];
XCTAssertEqualObjects(string, @"640x480");
[storeMock verify];
}
- (void)testStoringInvalidConstraintReturnsNo {
- __unused id storeMock = [self setupMockStoreWithMediaConstraintString:@"960x480"];
- XCTAssertFalse([_model storeVideoResoultionConstraint:@"960x480"]);
+ __unused id storeMock = [self setupMockStoreWithVideoResolution:@"960x480"];
+ XCTAssertFalse([_model storeVideoResolutionSetting:@"960x480"]);
}
- (void)testWidthConstraintFromStore {
- [self setupMockStoreWithMediaConstraintString:@"1270x480"];
- NSString *width = [_model currentVideoResolutionWidthFromStore];
+ [self setupMockStoreWithVideoResolution:@"1270x480"];
+ int width = [_model currentVideoResolutionWidthFromStore];
- XCTAssertEqualObjects(width, @"1270");
+ XCTAssertEqual(width, 1270);
}
- (void)testHeightConstraintFromStore {
- [self setupMockStoreWithMediaConstraintString:@"960x540"];
- NSString *height = [_model currentVideoResolutionHeightFromStore];
+ [self setupMockStoreWithVideoResolution:@"960x540"];
+ int height = [_model currentVideoResolutionHeightFromStore];
- XCTAssertEqualObjects(height, @"540");
+ XCTAssertEqual(height, 540);
}
- (void)testConstraintComponentIsNilWhenInvalidConstraintString {
- [self setupMockStoreWithMediaConstraintString:@"invalid"];
- NSString *width = [_model currentVideoResolutionWidthFromStore];
+ [self setupMockStoreWithVideoResolution:@"invalid"];
+ int width = [_model currentVideoResolutionWidthFromStore];
- XCTAssertNil(width);
-}
-
-- (void)testConstraintsDictionaryIsNilWhenInvalidConstraintString {
- [self setupMockStoreWithMediaConstraintString:@"invalid"];
- NSDictionary *constraintsDictionary = [_model currentMediaConstraintFromStoreAsRTCDictionary];
-
- XCTAssertNil(constraintsDictionary);
+ XCTAssertEqual(width, 0);
}
@end
« no previous file with comments | « webrtc/examples/objc/AppRTCMobile/mac/APPRTCViewController.m ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698