diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2018-01-05 09:13:10 -0500 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2018-01-05 09:13:10 -0500 |
commit | 07d7163779319e4f7a9ef36576e98c85ee5bee19 (patch) | |
tree | 772e26eff85fa7f60cd47d73c0a1711751ffb785 | |
parent | 9ffc411fa664534f5b26d8914ca0ec358994e072 (diff) | |
download | sdl_ios-07d7163779319e4f7a9ef36576e98c85ee5bee19.tar.gz |
Fix testcase
-rw-r--r-- | SmartDeviceLink/SDLLifecycleManager.m | 6 | ||||
-rw-r--r-- | SmartDeviceLink/SDLStreamingMediaLifecycleManager.m | 3 | ||||
-rw-r--r-- | SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m | 4 |
3 files changed, 8 insertions, 5 deletions
diff --git a/SmartDeviceLink/SDLLifecycleManager.m b/SmartDeviceLink/SDLLifecycleManager.m index 6025e72ab..1643534fb 100644 --- a/SmartDeviceLink/SDLLifecycleManager.m +++ b/SmartDeviceLink/SDLLifecycleManager.m @@ -242,7 +242,11 @@ SDLLifecycleState *const SDLLifecycleStateReady = @"Ready"; if (error != nil || ![response.success boolValue]) { SDLLogE(@"Failed to register the app. Error: %@, Response: %@", error, response); weakSelf.readyHandler(NO, error); - [weakSelf.lifecycleStateMachine transitionToState:SDLLifecycleStateStopped]; + + if (weakSelf.lifecycleState != SDLLifecycleStateReconnecting) { + [weakSelf.lifecycleStateMachine transitionToState:SDLLifecycleStateStopped]; + } + return; } diff --git a/SmartDeviceLink/SDLStreamingMediaLifecycleManager.m b/SmartDeviceLink/SDLStreamingMediaLifecycleManager.m index 2318d7223..080157de8 100644 --- a/SmartDeviceLink/SDLStreamingMediaLifecycleManager.m +++ b/SmartDeviceLink/SDLStreamingMediaLifecycleManager.m @@ -675,8 +675,7 @@ typedef void(^SDLVideoCapabilityResponseHandler)(SDLVideoStreamingCapability *_N return; } - if ([self.videoStreamStateMachine isCurrentState:SDLVideoStreamStateStopped] - && self.isHmiStateVideoStreamCapable) { + if ([self.videoStreamStateMachine isCurrentState:SDLVideoStreamStateStopped] && self.isHmiStateVideoStreamCapable) { [self.videoStreamStateMachine transitionToState:SDLVideoStreamStateStarting]; } else { SDLLogE(@"Unable to send video start service request\n" diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m index 17e42a750..df5e545d1 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLLifecycleManagerSpec.m @@ -208,8 +208,8 @@ describe(@"a lifecycle manager", ^{ [NSThread sleepForTimeInterval:0.1]; }); - it(@"should be in the started state", ^{ - expect(testManager.lifecycleState).to(match(SDLLifecycleStateStarted)); + fit(@"should be in the started state", ^{ + expect(testManager.lifecycleState).to(match(SDLLifecycleStateReconnecting)); }); }); |