diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2017-09-29 11:36:42 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2017-09-29 11:36:42 -0400 |
commit | abb4304cb16dd009b36002f2e5065901474e7cc7 (patch) | |
tree | 2a59410373f7dd11473d308950a8d065018be85a | |
parent | b833f2aa7bc60926f859873e0cd2c26c0ca65150 (diff) | |
download | sdl_ios-feature/haptic_integration.tar.gz |
Haptic manager test updatesfeature/haptic_integration
-rw-r--r-- | SmartDeviceLinkTests/SDLStreamingMediaLifecycleManagerSpec.m | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/SmartDeviceLinkTests/SDLStreamingMediaLifecycleManagerSpec.m b/SmartDeviceLinkTests/SDLStreamingMediaLifecycleManagerSpec.m index 0c887f2d3..93ec5eca7 100644 --- a/SmartDeviceLinkTests/SDLStreamingMediaLifecycleManagerSpec.m +++ b/SmartDeviceLinkTests/SDLStreamingMediaLifecycleManagerSpec.m @@ -17,6 +17,8 @@ #import "SDLGetSystemCapability.h" #import "SDLGetSystemCapabilityResponse.h" #import "SDLGlobals.h" +#import "SDLHapticInterface.h" +#import "SDLHapticManager.h" #import "SDLHMILevel.h" #import "SDLImageResolution.h" #import "SDLNotificationConstants.h" @@ -44,6 +46,7 @@ QuickSpecBegin(SDLStreamingMediaLifecycleManagerSpec) describe(@"the streaming media manager", ^{ __block SDLStreamingMediaLifecycleManager *streamingLifecycleManager = nil; __block SDLStreamingMediaConfiguration *testConfiguration = [SDLStreamingMediaConfiguration insecureConfiguration]; + __block UIWindow *testWindow = [[UIWindow alloc] init]; __block SDLFakeStreamingManagerDataSource *testDataSource = [[SDLFakeStreamingManagerDataSource alloc] init]; __block NSString *someBackgroundTitleString = nil; __block TestConnectionManager *testConnectionManager = nil; @@ -62,6 +65,7 @@ describe(@"the streaming media manager", ^{ (__bridge NSString *)kVTCompressionPropertyKey_ExpectedFrameRate : @1 }; testConfiguration.dataSource = testDataSource; + testConfiguration.window = testWindow; someBackgroundTitleString = @"Open Test App"; testConnectionManager = [[TestConnectionManager alloc] init]; streamingLifecycleManager = [[SDLStreamingMediaLifecycleManager alloc] initWithConnectionManager:testConnectionManager configuration:testConfiguration]; @@ -69,6 +73,7 @@ describe(@"the streaming media manager", ^{ it(@"should initialize properties", ^{ expect(streamingLifecycleManager.touchManager).toNot(beNil()); + expect(streamingLifecycleManager.hapticInterface).toNot(beNil()); expect(@(streamingLifecycleManager.isStreamingSupported)).to(equal(@NO)); expect(@(streamingLifecycleManager.isVideoConnected)).to(equal(@NO)); expect(@(streamingLifecycleManager.isAudioConnected)).to(equal(@NO)); @@ -222,7 +227,7 @@ describe(@"the streaming media manager", ^{ [testConnectionManager respondToLastRequestWithResponse:response]; }); - it(@"should have correct data from the data source", ^{ + it(@"should have set correct data", ^{ // Correct formats should be retrieved from the data source expect(streamingLifecycleManager.preferredResolutions).to(haveCount(1)); expect(streamingLifecycleManager.preferredResolutions.firstObject.resolutionWidth).to(equal(resolution.resolutionWidth)); @@ -231,6 +236,9 @@ describe(@"the streaming media manager", ^{ expect(streamingLifecycleManager.preferredFormats).to(haveCount(streamingLifecycleManager.supportedFormats.count + 1)); expect(streamingLifecycleManager.preferredFormats.firstObject.codec).to(equal(testDataSource.extraFormat.codec)); expect(streamingLifecycleManager.preferredFormats.firstObject.protocol).to(equal(testDataSource.extraFormat.protocol)); + + // The haptic manager should be enabled + expect(streamingLifecycleManager.hapticInterface.enableHapticDataRequests).to(equal(YES)); }); describe(@"if the app state is active", ^{ |