Skip to content

Commit

Permalink
Update according to review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
HSavynetska committed Jun 6, 2019
1 parent 07d4d9d commit f4d2de1
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 31 deletions.
2 changes: 1 addition & 1 deletion test_scripts/API/SDL_Passenger_Mode/001_OnDD_PT_true.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Set LockScreenDismissalEnabled", common.updatePreloadedPT, { lockScreenDismissalEnabled })
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("Register App", common.registerApp)
runner.Step("Register App", common.registerAppWithOnDD)

runner.Title("Test")

Expand Down
2 changes: 1 addition & 1 deletion test_scripts/API/SDL_Passenger_Mode/002_OnDD_PT_false.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Set LockScreenDismissalEnabled", common.updatePreloadedPT, { lockScreenDismissalEnabled })
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("Register App", common.registerApp)
runner.Step("Register App", common.registerAppWithOnDD)

runner.Title("Test")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Set LockScreenDismissalEnabled", common.updatePreloadedPT, { lockScreenDismissalEnabled })
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("Register App", common.registerApp)
runner.Step("Register App", common.registerAppWithOnDD)

runner.Title("Test")

Expand Down
2 changes: 1 addition & 1 deletion test_scripts/API/SDL_Passenger_Mode/004_OnDD_PTU_true.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Set LockScreenDismissalEnabled", common.updatePreloadedPT, { nil })
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("Register App", common.registerApp)
runner.Step("Register App", common.registerAppWithOnDD)

runner.Title("Test")
runner.Step("OnDriverDistraction ON/OFF missing", common.onDriverDistraction, { nil })
Expand Down
2 changes: 1 addition & 1 deletion test_scripts/API/SDL_Passenger_Mode/005_OnDD_PTU_false.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Set LockScreenDismissalEnabled", common.updatePreloadedPT, { nil })
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("Register App", common.registerApp)
runner.Step("Register App", common.registerAppWithOnDD)

runner.Title("Test")
runner.Step("OnDriverDistraction ON/OFF missing", common.onDriverDistraction, { nil })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Set LockScreenDismissalEnabled", common.updatePreloadedPT, { true })
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("Register App", common.registerApp)
runner.Step("Register App", common.registerAppWithOnDD)

runner.Title("Test")
runner.Step("OnDriverDistraction ON/OFF true", common.onDriverDistraction, { true })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,37 +102,14 @@ local function onDriverDistraction()
common.getHMIConnection():SendNotification("UI.OnDriverDistraction", { state = "DD_ON" })
end

local function registerApp()
common.getMobileSession(2):StartService(7)
:Do(function()
local corId = common.getMobileSession(2):SendRPC("RegisterAppInterface", common.getConfigAppParams(2))
common.getHMIConnection():ExpectNotification("BasicCommunication.OnAppRegistered",
{ application = { appName = common.getConfigAppParams(2).appName } })
:Do(function(_, d1)
common.setHMIAppId(d1.params.application.appID, 2)
common.getHMIConnection():ExpectRequest("BasicCommunication.PolicyUpdate")
:Do(function(_, d2)
common.getHMIConnection():SendResponse(d2.id, d2.method, "SUCCESS", { })
end)
end)
common.getMobileSession(2):ExpectResponse(corId, { success = true, resultCode = "SUCCESS" })
:Do(function()
common.getMobileSession(2):ExpectNotification("OnHMIStatus",
{ hmiLevel = "NONE", audioStreamingState = "NOT_AUDIBLE", systemContext = "MAIN" })
common.getMobileSession(2):ExpectNotification("OnPermissionsChange")
:Times(AnyNumber())
end)
end)
end

--[[ Scenario ]]
runner.Title("Preconditions")
runner.Step("Clean environment", common.preconditions)
runner.Step("Set LockScreenDismissalEnabled", updatePreloadedPT, { false })
runner.Step("Start SDL, HMI, connect Mobile, start Session", common.start)
runner.Step("onDriverDistraction DD_ON", onDriverDistraction)
runner.Step("Register App1", common.registerAppWOPTU, { 1 })
runner.Step("Register App2", registerApp)
runner.Step("Register App2", common.registerApp, { 2 })
runner.Step("App1 activation HMI level FULL", activateApp, { 1, 2, false })

runner.Title("Test")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ local preloadedPT = commonFunctions:read_parameter_from_smart_device_link_ini("P

--[[ Common Functions ]]
local registerAppOrig = c.registerApp
function c.registerApp(pAppId)
function c.registerAppWithOnDD(pAppId)
registerAppOrig(pAppId)
c.getMobileSession(pAppId):ExpectNotification("OnDriverDistraction", { state = "DD_OFF" })
end
Expand Down

0 comments on commit f4d2de1

Please sign in to comment.