mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
debug restore resolution
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
@@ -508,7 +508,8 @@ message OptionMessage {
|
||||
SupportedDecoding supported_decoding = 10;
|
||||
int32 custom_fps = 11;
|
||||
BoolOption disable_keyboard = 12;
|
||||
Resolution custom_resolution = 13;
|
||||
// Position 13 is used for Resolution. Remove later.
|
||||
// Resolution custom_resolution = 13;
|
||||
}
|
||||
|
||||
message TestDelay {
|
||||
|
||||
@@ -1567,7 +1567,20 @@ mod tests {
|
||||
let wrong_type_str = r#"
|
||||
view_style = "adaptive"
|
||||
scroll_style = "scrollbar"
|
||||
custom_resolution = true
|
||||
custom_resolutions = true
|
||||
"#;
|
||||
let mut cfg_to_compare = default_peer_config.clone();
|
||||
cfg_to_compare.view_style = "adaptive".to_string();
|
||||
cfg_to_compare.scroll_style = "scrollbar".to_string();
|
||||
let cfg = toml::from_str::<PeerConfig>(wrong_type_str);
|
||||
assert_eq!(cfg, Ok(cfg_to_compare), "Failed to test wrong_type_str");
|
||||
|
||||
let wrong_type_str = r#"
|
||||
view_style = "adaptive"
|
||||
scroll_style = "scrollbar"
|
||||
[custom_resolutions.0]
|
||||
w = "1920"
|
||||
h = 1080
|
||||
"#;
|
||||
let mut cfg_to_compare = default_peer_config.clone();
|
||||
cfg_to_compare.view_style = "adaptive".to_string();
|
||||
@@ -1576,14 +1589,15 @@ mod tests {
|
||||
assert_eq!(cfg, Ok(cfg_to_compare), "Failed to test wrong_type_str");
|
||||
|
||||
let wrong_field_str = r#"
|
||||
[custom_resolution]
|
||||
[custom_resolutions.0]
|
||||
w = 1920
|
||||
h = 1080
|
||||
hello = "world"
|
||||
[ui_flutter]
|
||||
"#;
|
||||
let mut cfg_to_compare = default_peer_config.clone();
|
||||
cfg_to_compare.custom_resolution = Some(Resolution { w: 1920, h: 1080 });
|
||||
cfg_to_compare.custom_resolutions =
|
||||
HashMap::from([("0".to_string(), Resolution { w: 1920, h: 1080 })]);
|
||||
let cfg = toml::from_str::<PeerConfig>(wrong_field_str);
|
||||
assert_eq!(cfg, Ok(cfg_to_compare), "Failed to test wrong_field_str");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user