fidl_fuchsia_ui_focus_test_helpers/
test_helpers.rs1use fidl_fuchsia_ui_focus::FocusChain;
8use fidl_fuchsia_ui_views::ViewRefControl;
9use fuchsia_scenic::ViewRefPair;
10
11pub fn make_focus_chain(length: usize) -> (FocusChain, Vec<ViewRefControl>) {
16 let mut view_refs = vec![];
17 let mut control_refs = vec![];
18 for _ in 0..length {
19 let ViewRefPair { control_ref, view_ref } = ViewRefPair::new().expect("making ViewRefPair");
20 view_refs.push(view_ref);
21 control_refs.push(control_ref);
22 }
23 let focus_chain = FocusChain { focus_chain: Some(view_refs), ..Default::default() };
24 (focus_chain, control_refs)
25}