Retain prompt resume resize until route transition
This commit is contained in:
parent
46b52b4b43
commit
29bc02fd7b
1 changed files with 84 additions and 13 deletions
|
|
@ -539,7 +539,7 @@ fn engine_for(fixture: &Fixture) -> (Arc<MockFactory>, SessionTerminalEngine) {
|
|||
|
||||
#[test]
|
||||
#[allow(clippy::too_many_lines)]
|
||||
fn production_prompt_adapter_routes_exact_authenticated_denial() {
|
||||
fn production_prompt_adapter_retains_resume_resize_before_authenticated_denial() {
|
||||
let generation = GenerationIdentity {
|
||||
agent_profile: "trusted".into(),
|
||||
domain_id: DomainId::new(bytes(1)),
|
||||
|
|
@ -607,7 +607,7 @@ fn production_prompt_adapter_routes_exact_authenticated_denial() {
|
|||
let factory = Arc::new(MockFactory::default());
|
||||
let mut engine = SessionTerminalEngine::new(
|
||||
Arc::clone(&fixture.store),
|
||||
factory,
|
||||
factory.clone(),
|
||||
prompt_transport.clone(),
|
||||
);
|
||||
engine.acquire(&acquisition(binding.session_id)).unwrap();
|
||||
|
|
@ -640,6 +640,18 @@ fn production_prompt_adapter_routes_exact_authenticated_denial() {
|
|||
batch.messages,
|
||||
vec![InteractiveSessionMessage::Prompt(expected_prompt.clone())]
|
||||
);
|
||||
let resumed_size = TerminalResize {
|
||||
session_id: binding.session_id,
|
||||
rows: NonZeroU16::new(55).unwrap(),
|
||||
columns: NonZeroU16::new(144).unwrap(),
|
||||
pixel_width: 1_440,
|
||||
pixel_height: 900,
|
||||
};
|
||||
control
|
||||
.exchange(InteractiveSessionEvent::Terminal(
|
||||
SessionTerminalEvent::Resize(resumed_size),
|
||||
))
|
||||
.unwrap();
|
||||
let signed_decision = encode_signed(
|
||||
&DeveloperDecision {
|
||||
protocol_version: ProtocolVersion::V1,
|
||||
|
|
@ -664,6 +676,19 @@ fn production_prompt_adapter_routes_exact_authenticated_denial() {
|
|||
.unwrap();
|
||||
assert_eq!(routed.signed_decision, signed_decision);
|
||||
assert_eq!(routed.decision.decision, DeveloperDecisionKind::Deny);
|
||||
assert_eq!(routed.resumed_size, Some(resumed_size));
|
||||
assert_eq!(
|
||||
factory.log.lock().unwrap().as_slice(),
|
||||
["resize:55x144", "signal:WINCH"]
|
||||
);
|
||||
assert!(
|
||||
!factory
|
||||
.log
|
||||
.lock()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.any(|event| event == "signal:TSTP")
|
||||
);
|
||||
assert_eq!(
|
||||
fixture
|
||||
.store
|
||||
|
|
|
|||
Loading…
Reference in a new issue