diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2019-10-09 14:03:19 -0400 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2019-10-09 14:03:19 -0400 |
commit | bea63601ac45b2956da49d257913885df1368a05 (patch) | |
tree | 53a6962887ddd002f0021a9dddd414ab8568419b | |
parent | 6b1c0e5d6bd92adc8852803e15de29800d0a3517 (diff) | |
download | sdl_ios-feature/issue_1276_main_menu_tiles.tar.gz |
Fix tests and documentation around menuLayoutsAvailablefeature/issue_1276_main_menu_tiles
6 files changed, 9 insertions, 17 deletions
diff --git a/SmartDeviceLink/SDLAddSubMenu.h b/SmartDeviceLink/SDLAddSubMenu.h index edc8babc5..338ecd645 100644 --- a/SmartDeviceLink/SDLAddSubMenu.h +++ b/SmartDeviceLink/SDLAddSubMenu.h @@ -73,7 +73,7 @@ NS_ASSUME_NONNULL_BEGIN @property (strong, nonatomic, nullable) SDLImage *menuIcon; /** - The sub-menu layout. See available menu layouts on DisplayCapabilities.menuLayoutsAvailable. Defaults to LIST. + The sub-menu layout. See available menu layouts on SDLWindowCapability.menuLayoutsAvailable. Defaults to LIST. */ @property (strong, nonatomic, nullable) SDLMenuLayout menuLayout; diff --git a/SmartDeviceLink/SDLScreenManager.h b/SmartDeviceLink/SDLScreenManager.h index 8275d79a0..0df4c21a6 100644 --- a/SmartDeviceLink/SDLScreenManager.h +++ b/SmartDeviceLink/SDLScreenManager.h @@ -126,7 +126,7 @@ typedef void(^SDLPreloadChoiceCompletionHandler)(NSError *__nullable error); /** Configures the layout of the menu and sub-menus. If set after a menu already exists, the existing main menu layout will be updated, _HOWEVER_ sub-menus will not be automatically updated; you will have to send a new menu to see the new submenu layout. - If set menu layouts don't match available menu layouts in DisplayCapabilities, an error log will be emitted and the layout will not be set. + If set menu layouts don't match available menu layouts in WindowCapability, an error log will be emitted and the layout will not be set. Setting this parameter will send a message to the remote system. This value will be set immediately, but if that message is rejected, the original value will be re-set and an error log will be emitted. diff --git a/SmartDeviceLinkTests/DevAPISpecs/SDLMenuManagerSpec.m b/SmartDeviceLinkTests/DevAPISpecs/SDLMenuManagerSpec.m index 5913be833..815105331 100644 --- a/SmartDeviceLinkTests/DevAPISpecs/SDLMenuManagerSpec.m +++ b/SmartDeviceLinkTests/DevAPISpecs/SDLMenuManagerSpec.m @@ -78,6 +78,7 @@ describe(@"menu manager", ^{ windowCapability.windowID = @(SDLPredefinedWindowsDefaultWindow); windowCapability.imageFields = @[commandIconField]; windowCapability.imageTypeSupported = @[SDLImageTypeDynamic, SDLImageTypeStatic]; + windowCapability.menuLayoutsAvailable = @[SDLMenuLayoutList, SDLMenuLayoutTiles]; SDLDisplayCapability *displayCapability = [[SDLDisplayCapability alloc] initWithDisplayName:SDLDisplayTypeGeneric]; displayCapability.windowCapabilities = @[windowCapability]; @@ -152,10 +153,10 @@ describe(@"menu manager", ^{ testManager.currentSystemContext = SDLSystemContextMenu; }); - it(@"should update the menu configuration", ^{ + fit(@"should update the menu configuration", ^{ testManager.menuConfiguration = testMenuConfiguration; - expect(mockConnectionManager.receivedRequests).to(beEmpty()); - expect(testManager.menuConfiguration).toNot(equal(testMenuConfiguration)); + expect(mockConnectionManager.receivedRequests).toNot(beEmpty()); + expect(testManager.menuConfiguration).to(equal(testMenuConfiguration)); }); }); }); @@ -583,8 +584,6 @@ describe(@"menu manager", ^{ context(@"if the connection RPC version is greater than or equal to 6.0.0", ^{ beforeEach(^{ [SDLGlobals sharedGlobals].rpcVersion = [SDLVersion versionWithString:@"6.0.0"]; - testManager.displayCapabilities = [[SDLDisplayCapabilities alloc] init]; - testManager.displayCapabilities.menuLayoutsAvailable = @[SDLMenuLayoutList, SDLMenuLayoutTiles]; }); it(@"should send a SetGlobalProperties RPC update", ^{ diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDisplayCapabilitiesSpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDisplayCapabilitiesSpec.m index fee0a20f0..6e89c7461 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDisplayCapabilitiesSpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDisplayCapabilitiesSpec.m @@ -27,8 +27,6 @@ SDLImageField* imageField = [[SDLImageField alloc] init]; #pragma clang diagnostic ignored "-Wdeprecated-declarations" describe(@"Getter/Setter Tests", ^ { - __block NSArray<SDLMenuLayout> *testLayout = @[SDLMenuLayoutTiles]; - it(@"Should set and get correctly", ^ { SDLDisplayCapabilities* testStruct = [[SDLDisplayCapabilities alloc] init]; @@ -41,8 +39,7 @@ describe(@"Getter/Setter Tests", ^ { testStruct.templatesAvailable = [@[@"String", @"String", @"String"] mutableCopy]; testStruct.screenParams = screenParams; testStruct.numCustomPresetsAvailable = @43; - testStruct.menuLayoutsAvailable = testLayout; - + expect(testStruct.displayType).to(equal(SDLDisplayTypeGen26DMA)); expect(testStruct.displayName).to(equal(@"test")); expect(testStruct.textFields).to(equal([@[textField] mutableCopy])); @@ -52,7 +49,6 @@ describe(@"Getter/Setter Tests", ^ { expect(testStruct.templatesAvailable).to(equal([@[@"String", @"String", @"String"] mutableCopy])); expect(testStruct.screenParams).to(equal(screenParams)); expect(testStruct.numCustomPresetsAvailable).to(equal(@43)); - expect(testStruct.menuLayoutsAvailable).to(equal(testLayout)); }); it(@"Should get correctly when initialized", ^ { @@ -65,7 +61,6 @@ describe(@"Getter/Setter Tests", ^ { SDLRPCParameterNameTemplatesAvailable:[@[@"String", @"String", @"String"] mutableCopy], SDLRPCParameterNameScreenParams:screenParams, SDLRPCParameterNameNumberCustomPresetsAvailable:@43, - SDLRPCParameterNameMenuLayoutsAvailable: testLayout }; SDLDisplayCapabilities* testStruct = [[SDLDisplayCapabilities alloc] initWithDictionary:dict]; @@ -78,7 +73,6 @@ describe(@"Getter/Setter Tests", ^ { expect(testStruct.templatesAvailable).to(equal([@[@"String", @"String", @"String"] mutableCopy])); expect(testStruct.screenParams).to(equal(screenParams)); expect(testStruct.numCustomPresetsAvailable).to(equal(@43)); - expect(testStruct.menuLayoutsAvailable).to(equal(testLayout)); }); it(@"Should return nil if not set", ^ { @@ -93,7 +87,6 @@ describe(@"Getter/Setter Tests", ^ { expect(testStruct.templatesAvailable).to(beNil()); expect(testStruct.screenParams).to(beNil()); expect(testStruct.numCustomPresetsAvailable).to(beNil()); - expect(testStruct.menuLayoutsAvailable).to(beNil()); }); }); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDisplayCapabilitySpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDisplayCapabilitySpec.m index 4cd68a799..1d0aad819 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDisplayCapabilitySpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLDisplayCapabilitySpec.m @@ -63,7 +63,6 @@ describe(@"Getter/Setter Tests", ^ { testWindowCapability.imageTypeSupported = @[testImageType]; testWindowCapability.buttonCapabilities = @[testButtonCapabilities]; testWindowCapability.softButtonCapabilities = @[testSoftButtonscapabilities]; - }); diff --git a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLWindowCapabilitySpec.m b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLWindowCapabilitySpec.m index 0589337ce..94eecde90 100644 --- a/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLWindowCapabilitySpec.m +++ b/SmartDeviceLinkTests/RPCSpecs/StructSpecs/SDLWindowCapabilitySpec.m @@ -17,7 +17,6 @@ QuickSpecBegin(SDLWindowCapabilitySpec) describe(@"Getter/Setter Tests", ^ { - __block SDLTextField* testTextField = nil; __block SDLImageField *testImageField = nil; __block SDLButtonCapabilities *testButtonCapabilities = nil; @@ -55,6 +54,7 @@ describe(@"Getter/Setter Tests", ^ { testStruct.imageTypeSupported = @[testImageType]; testStruct.buttonCapabilities = @[testButtonCapabilities]; testStruct.softButtonCapabilities = @[testSoftButtonscapabilities]; + testStruct.menuLayoutsAvailable = @[SDLMenuLayoutTiles]; expect(testStruct.windowID).to(equal(@444)); expect(testStruct.textFields.firstObject.name).to(equal(SDLTextFieldNameTertiaryText)); @@ -65,6 +65,7 @@ describe(@"Getter/Setter Tests", ^ { expect(testStruct.buttonCapabilities.firstObject.longPressAvailable).to(equal(@YES)); expect(testStruct.buttonCapabilities.firstObject.name).to(equal(SDLButtonNameOk)); expect(testStruct.softButtonCapabilities.firstObject.imageSupported).to(equal(@YES)); + expect(testStruct.menuLayoutsAvailable).to(equal(@[SDLMenuLayoutTiles])); }); }); |