@@ -202,7 +202,7 @@ export class DeviceManager implements IDeviceManager {
202
202
args . device . config = { "density" : args . device . deviceScreenDensity || args . device . config . density , "offsetPixels" : + sessionInfoDetails . statBarHeight || args . device . config . offsetPixels } ;
203
203
} else {
204
204
args . device . apiLevel = sessionInfoDetails . platformVersion ;
205
- args . device . deviceScreenDensity = sessionInfoDetails . pixelRatio ;
205
+ args . device . deviceScreenDensity = sessionInfoDetails . pixelRatio || args . device . config . density ;
206
206
const offsetPixels = + sessionInfoDetails . viewportRect . top - + sessionInfoDetails . statBarHeight ;
207
207
args . device . config = { "density" : sessionInfoDetails . pixelRatio || args . device . config . density , "offsetPixels" : isNumber ( offsetPixels ) ? offsetPixels : args . device . config . offsetPixels } ;
208
208
}
@@ -272,11 +272,11 @@ export class DeviceManager implements IDeviceManager {
272
272
// }
273
273
274
274
public static async applyDeviceAdditionsSettings ( driver , args : INsCapabilities , sessionInfo : any ) {
275
- if ( ( ! args . device . viewportRect || ! args . device . viewportRect . x ) && ( ! args . device . config || ! args . device . config . offsetPixels ) ) {
275
+ if ( ( ! args . device . viewportRect || ! args . device . viewportRect . x ) && ( ! args . device . config || ! isNumber ( args . device . config . offsetPixels ) ) ) {
276
276
args . device . config = { } ;
277
277
let density : number ;
278
- if ( sessionInfo && sessionInfo . length >= 1 ) {
279
- density = sessionInfo [ 1 ] . deviceScreenDensity ? sessionInfo [ 1 ] . deviceScreenDensity / 100 : undefined ;
278
+ if ( sessionInfo && Object . getOwnPropertyNames ( sessionInfo ) . length >= 1 ) {
279
+ density = sessionInfo . pixelRatio ? sessionInfo . pixelRatio : undefined ;
280
280
}
281
281
282
282
if ( density ) {
0 commit comments