Move window-related methods from TestAppContext to AnyWindowHandle
This commit is contained in:
parent
0197d49230
commit
f2be3181a9
6 changed files with 118 additions and 128 deletions
|
@ -1290,7 +1290,8 @@ async fn test_move_start_of_paragraph_end_of_paragraph(cx: &mut gpui::TestAppCon
|
|||
let mut cx = EditorTestContext::new(cx).await;
|
||||
|
||||
let line_height = cx.editor(|editor, cx| editor.style(cx).text.line_height(cx.font_cache()));
|
||||
cx.simulate_window_resize(cx.window.id(), vec2f(100., 4. * line_height));
|
||||
let window = cx.window;
|
||||
window.simulate_resize(vec2f(100., 4. * line_height), &mut cx);
|
||||
|
||||
cx.set_state(
|
||||
&r#"ˇone
|
||||
|
@ -1401,7 +1402,8 @@ async fn test_scroll_page_up_page_down(cx: &mut gpui::TestAppContext) {
|
|||
init_test(cx, |_| {});
|
||||
let mut cx = EditorTestContext::new(cx).await;
|
||||
let line_height = cx.editor(|editor, cx| editor.style(cx).text.line_height(cx.font_cache()));
|
||||
cx.simulate_window_resize(cx.window.id(), vec2f(1000., 4. * line_height + 0.5));
|
||||
let window = cx.window;
|
||||
window.simulate_resize(vec2f(1000., 4. * line_height + 0.5), &mut cx);
|
||||
|
||||
cx.set_state(
|
||||
&r#"ˇone
|
||||
|
@ -1439,7 +1441,8 @@ async fn test_move_page_up_page_down(cx: &mut gpui::TestAppContext) {
|
|||
let mut cx = EditorTestContext::new(cx).await;
|
||||
|
||||
let line_height = cx.editor(|editor, cx| editor.style(cx).text.line_height(cx.font_cache()));
|
||||
cx.simulate_window_resize(cx.window.id(), vec2f(100., 4. * line_height));
|
||||
let window = cx.window;
|
||||
window.simulate_resize(vec2f(100., 4. * line_height), &mut cx);
|
||||
|
||||
cx.set_state(
|
||||
&r#"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue