use mediadecode::decoder::ScaledOutputCapability;
use super::ScaledOutput;
#[test]
fn the_request_seat_answers_what_this_target_can_do() {
let mut stage = ScaledOutput::new();
let accepted = stage.request((512, 288), (1920, 1080));
if ScaledOutput::supported() {
assert_eq!(accepted, ScaledOutputCapability::Supported);
assert_eq!(stage.requested(), Some((512, 288)));
} else {
assert_eq!(accepted, ScaledOutputCapability::Unsupported);
assert_eq!(stage.requested(), None);
}
}
#[test]
fn a_refused_request_returns_the_session_to_full_size() {
let mut stage = ScaledOutput::new();
let first = stage.request((512, 288), (1920, 1080));
assert_eq!(
stage.request((0, 288), (1920, 1080)),
ScaledOutputCapability::Unsupported
);
if ScaledOutput::supported() {
assert_eq!(first, ScaledOutputCapability::Supported);
}
assert_eq!(
stage.requested(),
None,
"a refused request returns the session to full size"
);
assert_eq!(
stage.request((3840, 2160), (1920, 1080)),
ScaledOutputCapability::Unsupported
);
assert_eq!(stage.requested(), None);
}