summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2020-06-09 14:05:01 -0400
committerNicoleYarroch <nicole@livio.io>2020-06-09 14:05:01 -0400
commitc0f79db1d284f468bf149bf6082363bda607c858 (patch)
tree9e871beb7ad6b9289aa69c23418264ffbfd8beff
parent3bdd507b7b7d902ba28f059e001f436e98459c6d (diff)
downloadsdl_ios-c0f79db1d284f468bf149bf6082363bda607c858.tar.gz
Attempting to fix failed background task tests
Signed-off-by: NicoleYarroch <nicole@livio.io>
-rw-r--r--SmartDeviceLinkTests/ProxySpecs/SDLSecondaryTransportManagerSpec.m11
1 files changed, 7 insertions, 4 deletions
diff --git a/SmartDeviceLinkTests/ProxySpecs/SDLSecondaryTransportManagerSpec.m b/SmartDeviceLinkTests/ProxySpecs/SDLSecondaryTransportManagerSpec.m
index f4947008b..768889f68 100644
--- a/SmartDeviceLinkTests/ProxySpecs/SDLSecondaryTransportManagerSpec.m
+++ b/SmartDeviceLinkTests/ProxySpecs/SDLSecondaryTransportManagerSpec.m
@@ -1118,12 +1118,13 @@ describe(@"the secondary transport manager ", ^{
manager.secondaryTransportType = SDLTransportSelectionTCP;
[manager.stateMachine setToState:SDLSecondaryTransportStateConfigured fromOldState:nil callEnterTransition:NO];
-
- [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidBecomeActiveNotification object:nil];
});
it(@"should end the background task and try to restart the TCP transport", ^{
OCMExpect([mockBackgroundTaskManager endBackgroundTask]);
+
+ [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidBecomeActiveNotification object:nil];
+
OCMVerifyAllWithDelay(mockBackgroundTaskManager, 0.5);
expect(manager.stateMachine.currentState).toEventually(equal(SDLSecondaryTransportStateConnecting));
});
@@ -1132,13 +1133,15 @@ describe(@"the secondary transport manager ", ^{
describe(@"if the secondary transport not connected and is not configured", ^{
beforeEach(^{
[manager.stateMachine setToState:SDLSecondaryTransportStateConnecting fromOldState:nil callEnterTransition:NO];
- [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidBecomeActiveNotification object:nil];
});
it(@"should ignore the state change notification", ^{
OCMReject([mockBackgroundTaskManager endBackgroundTask]);
- expect(manager.stateMachine.currentState).toEventually(equal(SDLSecondaryTransportStateConnecting));
+
+ [[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidBecomeActiveNotification object:nil];
+
OCMVerifyAllWithDelay(mockBackgroundTaskManager, 0.5);
+ expect(manager.stateMachine.currentState).toEventually(equal(SDLSecondaryTransportStateConnecting));
});
});
});