deserializeCommand method Null safety
- Map<
String, String> params, - DeserializeFinderFactory finderFactory
Deserializes the finder from JSON generated by Command.serialize or CommandWithTarget.serialize.
Implementation
Command deserializeCommand(Map<String, String> params, DeserializeFinderFactory finderFactory) {
final String? kind = params['command'];
switch(kind) {
case 'get_health': return GetHealth.deserialize(params);
case 'get_layer_tree': return GetLayerTree.deserialize(params);
case 'get_render_tree': return GetRenderTree.deserialize(params);
case 'enter_text': return EnterText.deserialize(params);
case 'get_text': return GetText.deserialize(params, finderFactory);
case 'request_data': return RequestData.deserialize(params);
case 'scroll': return Scroll.deserialize(params, finderFactory);
case 'scrollIntoView': return ScrollIntoView.deserialize(params, finderFactory);
case 'set_frame_sync': return SetFrameSync.deserialize(params);
case 'set_semantics': return SetSemantics.deserialize(params);
case 'set_text_entry_emulation': return SetTextEntryEmulation.deserialize(params);
case 'tap': return Tap.deserialize(params, finderFactory);
case 'waitFor': return WaitFor.deserialize(params, finderFactory);
case 'waitForAbsent': return WaitForAbsent.deserialize(params, finderFactory);
case 'waitForTappable': return WaitForTappable.deserialize(params, finderFactory);
case 'waitForCondition': return WaitForCondition.deserialize(params);
case 'waitUntilNoTransientCallbacks': return WaitForCondition.deserialize(params);
case 'waitUntilNoPendingFrame': return WaitForCondition.deserialize(params);
case 'waitUntilFirstFrameRasterized': return WaitForCondition.deserialize(params);
case 'get_semantics_id': return GetSemanticsId.deserialize(params, finderFactory);
case 'get_offset': return GetOffset.deserialize(params, finderFactory);
case 'get_diagnostics_tree': return GetDiagnosticsTree.deserialize(params, finderFactory);
}
throw DriverError('Unsupported command kind $kind');
}