diff options
author | JackLivio <jack@livio.io> | 2017-07-19 09:57:56 -0400 |
---|---|---|
committer | JackLivio <jack@livio.io> | 2017-07-19 09:57:56 -0400 |
commit | 5d8de6b299da0347092115584377d2e0134f37db (patch) | |
tree | 420b8f643c898fba29a2f7e8f84e32fb95f99d48 | |
parent | 13a3199045adfde25842fcf7a76a64bb98aecc0e (diff) | |
download | sdl_core-5d8de6b299da0347092115584377d2e0134f37db.tar.gz |
Unit Test: Load capabilities from file
-rw-r--r-- | src/components/application_manager/test/hmi_capabilities.json | 786 | ||||
-rw-r--r-- | src/components/application_manager/test/hmi_capabilities_test.cc | 18 |
2 files changed, 391 insertions, 413 deletions
diff --git a/src/components/application_manager/test/hmi_capabilities.json b/src/components/application_manager/test/hmi_capabilities.json index 61cda5ce43..4e43bcb72c 100644 --- a/src/components/application_manager/test/hmi_capabilities.json +++ b/src/components/application_manager/test/hmi_capabilities.json @@ -1,466 +1,428 @@ { - "UI": - { - "language":"EN_US", - "languages":[ - "EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW", -"JA_JP","AR_SA","KO_KR","PT_BR","CS_CZ","DA_DK","NO_NO" + "UI": { + "language": "EN_US", + "languages": [ + "EN_US", "ES_MX", "FR_CA", "DE_DE", "ES_ES", "EN_GB", "RU_RU", "TR_TR", "PL_PL", "FR_FR", "IT_IT", "SV_SE", "PT_PT", "NL_NL", "ZH_TW", + "JA_JP", "AR_SA", "KO_KR", "PT_BR", "CS_CZ", "DA_DK", "NO_NO" ], - "displayCapabilities": - { - "displayType":"GEN2_8_DMA", + "displayCapabilities": { + "displayType": "GEN2_8_DMA", "textFields": [{ - "name": "mainField1", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "mainField2", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "mainField3", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "mainField4", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "statusBar", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "mediaClock", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "mediaTrack", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "alertText1", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "alertText2", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "alertText3", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "scrollableMessageBody", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "initialInteractionText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "navigationText1", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "navigationText2", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "ETA", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "totalDistance", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "navigationText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "audioPassThruDisplayText1", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "audioPassThruDisplayText2", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "sliderHeader", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "sliderFooter", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "notificationText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "menuName", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "secondaryText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "tertiaryText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "timeToDestination", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "turnText", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - }, - { - "name": "menuTitle", - "characterSet": "TYPE2SET", - "width": 500, - "rows": 1 - } - ], - "imageFields": - [ - { - "name":"softButtonImage", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"choiceImage", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"choiceSecondaryImage", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"menuIcon", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"cmdIcon", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"appIcon", - "imageTypeSupported": - [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"graphic", - "imageTypeSupported": - [ + "name": "mainField1", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "mainField2", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "mainField3", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "mainField4", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "statusBar", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "mediaClock", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "mediaTrack", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "alertText1", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "alertText2", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "alertText3", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "scrollableMessageBody", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "initialInteractionText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "navigationText1", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "navigationText2", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "ETA", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "totalDistance", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "navigationText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "audioPassThruDisplayText1", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "audioPassThruDisplayText2", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "sliderHeader", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "sliderFooter", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "notificationText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "menuName", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "secondaryText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "tertiaryText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "timeToDestination", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "turnText", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + }, + { + "name": "menuTitle", + "characterSet": "TYPE2SET", + "width": 500, + "rows": 1 + } + ], + "imageFields": [{ + "name": "softButtonImage", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "choiceImage", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "choiceSecondaryImage", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "menuIcon", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "cmdIcon", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "appIcon", + "imageTypeSupported": [], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "graphic", + "imageTypeSupported": [ - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - }, - { - "name":"locationImage", - "imageTypeSupported": - [ - "GRAPHIC_PNG" - ], - "imageResolution": - { - "resolutionWidth":35, - "resolutionHeight":35 - } - } + ], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + }, + { + "name": "locationImage", + "imageTypeSupported": [ + "GRAPHIC_PNG" + ], + "imageResolution": { + "resolutionWidth": 35, + "resolutionHeight": 35 + } + } - ], - "mediaClockFormats": - [ - "CLOCK1","CLOCK2","CLOCK3","CLOCKTEXT1","CLOCKTEXT2","CLOCKTEXT3","CLOCKTEXT4" ], - "graphicSupported":true, - "templatesAvailable": - [ + "mediaClockFormats": [ + "CLOCK1", "CLOCK2", "CLOCK3", "CLOCKTEXT1", "CLOCKTEXT2", "CLOCKTEXT3", "CLOCKTEXT4" + ], + "graphicSupported": true, + "templatesAvailable": [ - "DEFAULT","MEDIA","NON-MEDIA","ONSCREEN_PRESETS","NAV_FULLSCREEN_MAP","NAV_KEYBOARD", - "GRAPHIC_WITH_TEXT","TEXT_WITH_GRAPHIC","TILES_ONLY","TEXTBUTTONS_ONLY", - "GRAPHIC_WITH_TILES","TILES_WITH_GRAPHIC","GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS", - "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC","GRAPHIC_WITH_TEXTBUTTONS", - "TEXTBUTTONS_WITH_GRAPHIC","LARGE_GRAPHIC_WITH_SOFTBUTTONS", - "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS","LARGE_GRAPHIC_ONLY" - ], - "screenParams": - { - "resolution": - { - "resolutionWidth":800, - "resolutionHeight":350 - }, - "touchEventAvailable": - { - "pressAvailable":true, - "multiTouchAvailable":false, - "doublePressAvailable":false - } - }, - "numCustomPresetsAvailable":8, - "imageCapabilities": - [ + "DEFAULT", "MEDIA", "NON-MEDIA", "ONSCREEN_PRESETS", "NAV_FULLSCREEN_MAP", "NAV_KEYBOARD", + "GRAPHIC_WITH_TEXT", "TEXT_WITH_GRAPHIC", "TILES_ONLY", "TEXTBUTTONS_ONLY", + "GRAPHIC_WITH_TILES", "TILES_WITH_GRAPHIC", "GRAPHIC_WITH_TEXT_AND_SOFTBUTTONS", + "TEXT_AND_SOFTBUTTONS_WITH_GRAPHIC", "GRAPHIC_WITH_TEXTBUTTONS", + "TEXTBUTTONS_WITH_GRAPHIC", "LARGE_GRAPHIC_WITH_SOFTBUTTONS", + "DOUBLE_GRAPHIC_WITH_SOFTBUTTONS", "LARGE_GRAPHIC_ONLY" + ], + "screenParams": { + "resolution": { + "resolutionWidth": 800, + "resolutionHeight": 350 + }, + "touchEventAvailable": { + "pressAvailable": true, + "multiTouchAvailable": false, + "doublePressAvailable": false + } + }, + "numCustomPresetsAvailable": 8, + "imageCapabilities": [ "DYNAMIC", "STATIC" ] }, - "audioPassThruCapabilities": - { - "samplingRate" : "44KHZ", - "bitsPerSample" : "RATE_8_BIT", - "audioType" : "PCM" + "audioPassThruCapabilities": { + "samplingRate": "44KHZ", + "bitsPerSample": "RATE_8_BIT", + "audioType": "PCM" }, - "pcmStreamCapabilities": - { - "samplingRate" : "16KHZ", - "bitsPerSample" : "RATE_16_BIT", - "audioType" : "PCM" + "pcmStreamCapabilities": { + "samplingRate": "16KHZ", + "bitsPerSample": "RATE_16_BIT", + "audioType": "PCM" }, - "hmiZoneCapabilities":"FRONT", - "softButtonCapabilities": - [ - { - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true, - "imageSupported" :true + "hmiZoneCapabilities": "FRONT", + "softButtonCapabilities": [{ + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true, + "imageSupported": true + }], + "systemCapabilities": { + "navigationCapability": { + "sendLocationEnabled": true, + "getWayPointsEnabled": true + }, + "phoneCapability": { + "dialNumberEnabled": true } + } + }, + "VR": { + "capabilities": ["TEXT"], + "language": "ES_MX", + "languages": [ + "AR_SA", "EN_US", "ES_MX", "FR_CA", "DE_DE", "ES_ES", "EN_GB", "RU_RU", "TR_TR", "PL_PL", "FR_FR", "IT_IT", "SV_SE", "PT_PT", "NL_NL", "ZH_TW", + "JA_JP", "KO_KR", "PT_BR", "CS_CZ", "DA_DK", "NO_NO" ] }, - "VR": - { - "capabilities":["TEXT"], - "language":"ES_MX", - "languages": - [ - "AR_SA", "EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW", -"JA_JP","KO_KR","PT_BR","CS_CZ","DA_DK","NO_NO" - ] -}, - "TTS": - { - "capabilities":["TEXT"], - "language":"DE_DE", - "languages": - [ - "DA_DK","CS_CZ","KO_KR","EN_US","ES_MX","FR_CA","DE_DE","ES_ES","EN_GB","RU_RU","TR_TR","PL_PL","FR_FR","IT_IT","SV_SE","PT_PT","NL_NL","ZH_TW", -"JA_JP","AR_SA","PT_BR","NO_NO" + "TTS": { + "capabilities": ["TEXT"], + "language": "DE_DE", + "languages": [ + "DA_DK", "CS_CZ", "KO_KR", "EN_US", "ES_MX", "FR_CA", "DE_DE", "ES_ES", "EN_GB", "RU_RU", "TR_TR", "PL_PL", "FR_FR", "IT_IT", "SV_SE", "PT_PT", "NL_NL", "ZH_TW", + "JA_JP", "AR_SA", "PT_BR", "NO_NO" ] }, - "Buttons": - { - "capabilities": - [ - { - "name":"PRESET_0", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "Buttons": { + "capabilities": [{ + "name": "PRESET_0", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_1", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_1", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_2", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_2", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_3", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_3", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_4", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_4", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_5", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_5", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_6", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_6", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_7", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_7", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_8", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_8", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"PRESET_9", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "PRESET_9", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"OK", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "OK", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"SEEKLEFT", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "SEEKLEFT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"SEEKRIGHT", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "SEEKRIGHT", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"TUNEUP", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "TUNEUP", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true }, { - "name":"TUNEDOWN", - "shortPressAvailable":true, - "longPressAvailable" :true, - "upDownAvailable" :true + "name": "TUNEDOWN", + "shortPressAvailable": true, + "longPressAvailable": true, + "upDownAvailable": true } ], - "presetBankCapabilities": - { - "onScreenPresetsAvailable":true + "presetBankCapabilities": { + "onScreenPresetsAvailable": true } }, - "VehicleInfo": - { - "make" :"Ford", - "model" :"Fiesta", - "modelYear" :"2013", - "trim" :"SE" + "VehicleInfo": { + "make": "Ford", + "model": "Fiesta", + "modelYear": "2013", + "trim": "SE" }, - "SyncMessageVersion": - { + "SyncMessageVersion": { "majorVersion": 3, "minorVersion": 0 } -} +}
\ No newline at end of file diff --git a/src/components/application_manager/test/hmi_capabilities_test.cc b/src/components/application_manager/test/hmi_capabilities_test.cc index 4eb9f920d9..a9c5e147b2 100644 --- a/src/components/application_manager/test/hmi_capabilities_test.cc +++ b/src/components/application_manager/test/hmi_capabilities_test.cc @@ -351,12 +351,28 @@ TEST_F(HMICapabilitiesTest, LoadCapabilitiesFromFile) { // Check vehicle type const smart_objects::SmartObject vehicle_type_so = *(hmi_capabilities_test->vehicle_type()); - EXPECT_TRUE(preset_bank_so["onScreenPresetsAvailable"].asBool()); EXPECT_EQ("Ford", vehicle_type_so["make"].asString()); EXPECT_EQ("Fiesta", vehicle_type_so["model"].asString()); EXPECT_EQ("2013", vehicle_type_so["modelYear"].asString()); EXPECT_EQ("SE", vehicle_type_so["trim"].asString()); + + //Check system capabilities + smart_objects::SmartObject navigation_capability_so = + *(hmi_capabilities_test->navigation_capability()); + + EXPECT_TRUE(navigation_capability_so.keyExists("sendLocationEnabled")); + EXPECT_TRUE(navigation_capability_so.keyExists("getWayPointsEnabled")); + EXPECT_TRUE(navigation_capability_so["sendLocationEnabled"].asBool()); + EXPECT_TRUE(navigation_capability_so["getWayPointsEnabled"].asBool()); + + const smart_objects::SmartObject phone_capability_so = + *(hmi_capabilities_test->phone_capability()); + + EXPECT_TRUE(phone_capability_so.keyExists("dialNumberEnabled")); + EXPECT_TRUE(phone_capability_so["dialNumberEnabled"].asBool()); + + } TEST_F(HMICapabilitiesTest, VerifyImageType) { |