mirror of
https://github.com/storytold/deckcraft.git
synced 2026-12-01 18:23:52 -06:00
Combine production merge area tests-b
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -46,23 +46,8 @@ fn play_on_the_editor_media_bar_plays_the_selected_clip() {
|
||||
s.execute("slide.new", &json!({"layout": "blank"})).unwrap();
|
||||
let r = s.execute("insert.audio", &json!({"name": "tone.wav", "data": deckcraft_engine::cmd::base64_encode(&wav(2.0))})).unwrap();
|
||||
let id = ShapeId(r["id"].as_u64().unwrap() as u32);
|
||||
<<<<<<< HEAD
|
||||
let mut h =
|
||||
test_harness::harness_with(s, Services::default(), Harness::builder().with_size(vec2(1400.0, 900.0)).with_step_dt(1.0 / 60.0), |_| {});
|
||||
=======
|
||||
let app = SlideApp::new(s, Services::default());
|
||||
let mut h = Harness::builder()
|
||||
.with_context_setup(crate::framework::install_headless)
|
||||
.with_size(vec2(1400.0, 900.0))
|
||||
.with_step_dt(1.0 / 60.0)
|
||||
.build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
let d = h.state().session.active().unwrap();
|
||||
assert_eq!(d.selection.shapes, vec![id], "the inserted clip is selected");
|
||||
@@ -117,27 +102,10 @@ fn the_media_bar_never_paints_or_clicks_into_the_notes_pane() {
|
||||
// Dragged across the bottom edge of the slide, onto the pasteboard.
|
||||
let h_slide = s.doc().unwrap().doc.slide_size.height;
|
||||
s.execute("shape.setBounds", &json!({"ids": [id.0], "x": 300.0, "y": h_slide - 10.0, "w": 120.0, "h": 60.0})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut h =
|
||||
test_harness::harness_with(s, Services::default(), Harness::builder().with_size(vec2(1400.0, 900.0)).with_step_dt(1.0 / 60.0), |_| {});
|
||||
h.state_mut().ui.notes = true;
|
||||
h.state_mut().ui.notes_height = 140.0;
|
||||
=======
|
||||
let mut app = SlideApp::new(s, Services::default());
|
||||
app.ui.notes = true;
|
||||
app.ui.notes_height = 140.0;
|
||||
let mut h = Harness::builder()
|
||||
.with_context_setup(crate::framework::install_headless)
|
||||
.with_size(vec2(1400.0, 900.0))
|
||||
.with_step_dt(1.0 / 60.0)
|
||||
.build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
let notes = h.query_all_by_role(Role::MultilineTextInput).next().map(|n| n.rect()).expect("the notes field");
|
||||
let canvas = h.state().canvas_rect().unwrap();
|
||||
|
||||
@@ -13,23 +13,10 @@ use crate::{Services, SlideApp};
|
||||
/// 1×1 PNG.
|
||||
const PNG: &str = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg==";
|
||||
|
||||
<<<<<<< HEAD
|
||||
fn harness(session: Session) -> Harness<'static, SlideApp> {
|
||||
let mut h = crate::test_harness::harness_with(session, Services::default(), Harness::builder().with_size(egui::vec2(1800.0, 1100.0)), |_| {});
|
||||
h.state_mut().ui.tab = "Design".into();
|
||||
h.state_mut().ui.pane = Some("background".into());
|
||||
=======
|
||||
fn harness(mut app: SlideApp) -> Harness<'static, SlideApp> {
|
||||
app.ui.tab = "Design".into();
|
||||
app.ui.pane = Some("background".into());
|
||||
let mut h = Harness::builder().with_context_setup(crate::framework::install_headless).with_size(egui::vec2(1800.0, 1100.0)).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
h
|
||||
}
|
||||
|
||||
@@ -15,22 +15,9 @@ fn harness() -> Harness<'static, SlideApp> {
|
||||
let r = s.execute("shape.insert", &json!({"preset": "rect", "rect": [80.0, 80.0, 200.0, 120.0]})).unwrap();
|
||||
let id = r.get("id").and_then(|v| v.as_u64()).unwrap();
|
||||
s.execute("edit.select", &json!({"ids": [id]})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut h = crate::test_harness::harness_with(s, Services::default(), Harness::builder().with_size(egui::vec2(1800.0, 1100.0)), |_| {});
|
||||
h.state_mut().ui.pane = Some("format".into());
|
||||
h.state_mut().ui.format_tab = "fill".into();
|
||||
=======
|
||||
let mut app = SlideApp::new(s, Services::default());
|
||||
app.ui.pane = Some("format".into());
|
||||
app.ui.format_tab = "effects".into();
|
||||
let mut h = Harness::builder().with_context_setup(crate::framework::install_headless).with_size(egui::vec2(1800.0, 1100.0)).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
click(&mut h, "Effects");
|
||||
h
|
||||
|
||||
@@ -12,21 +12,9 @@ use serde_json::json;
|
||||
|
||||
use crate::{Services, SlideApp};
|
||||
|
||||
<<<<<<< HEAD
|
||||
fn harness(session: Session, pane: &str) -> Harness<'static, SlideApp> {
|
||||
let mut h = crate::test_harness::harness_with(session, Services::default(), Harness::builder().with_size(egui::vec2(1800.0, 1100.0)), |_| {});
|
||||
h.state_mut().ui.pane = Some(pane.into());
|
||||
=======
|
||||
fn harness(mut app: SlideApp, pane: &str) -> Harness<'static, SlideApp> {
|
||||
app.ui.pane = Some(pane.into());
|
||||
let mut h = Harness::builder().with_context_setup(crate::framework::install_headless).with_size(egui::vec2(1800.0, 1100.0)).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
h
|
||||
}
|
||||
|
||||
@@ -23,24 +23,8 @@ fn harness() -> (Harness<'static, SlideApp>, Vec<u32>) {
|
||||
s.execute("shape.rename", &json!({"id": g, "name": "G"})).unwrap();
|
||||
s.execute("edit.select", &json!({"ids": []})).unwrap();
|
||||
ids.push(g);
|
||||
<<<<<<< HEAD
|
||||
let mut h = crate::test_harness::harness(s, Services::default());
|
||||
h.state_mut().run("view.pane", json!({"pane": "selection"})).unwrap();
|
||||
=======
|
||||
let mut app = SlideApp::new(s, Services::default());
|
||||
app.ui.pane = Some("selection".into());
|
||||
let mut h = Harness::builder()
|
||||
.with_context_setup(crate::framework::install_headless)
|
||||
.with_size(egui::vec2(1400.0, 900.0))
|
||||
.with_step_dt(1.0 / 60.0)
|
||||
.build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
(h, ids)
|
||||
}
|
||||
|
||||
@@ -23,24 +23,8 @@ fn text_pane_types_adds_and_demotes() {
|
||||
let mut s = Session::with_new();
|
||||
s.execute("slide.new", &json!({"layout": "blank"})).unwrap();
|
||||
s.execute("insert.smartArt", &json!({"kind": "list", "items": ["Plan", "Build"]})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut h = harness(s, Services::default());
|
||||
h.state_mut().ui.pane = Some("smartart".into());
|
||||
=======
|
||||
let mut app = SlideApp::new(s, Services::default());
|
||||
app.ui.pane = Some("smartart".into());
|
||||
let mut h = Harness::builder()
|
||||
.with_context_setup(crate::framework::install_headless)
|
||||
.with_size(egui::vec2(1400.0, 900.0))
|
||||
.with_step_dt(1.0 / 60.0)
|
||||
.build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
assert!(h.query_all_by_label("Text Pane").any(|n| n.accesskit_node().role() != egui::accesskit::Role::Button), "the pane is titled");
|
||||
let initial = levels(&h);
|
||||
@@ -119,22 +103,7 @@ fn home_convert_to_smartart_gallery_converts_the_text() {
|
||||
let mut s = Session::with_new();
|
||||
s.execute("slide.new", &json!({"layout": "blank"})).unwrap();
|
||||
s.execute("insert.textBox", &json!({"text": "Goals\nRevenue\nGrowth"})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut h = harness_with(s, Services::default(), Harness::builder().with_size(egui::vec2(1600.0, 900.0)).with_step_dt(1.0 / 60.0), |_| {});
|
||||
=======
|
||||
let app = SlideApp::new(s, Services::default());
|
||||
let mut h = Harness::builder()
|
||||
.with_context_setup(crate::framework::install_headless)
|
||||
.with_size(egui::vec2(1600.0, 900.0))
|
||||
.with_step_dt(1.0 / 60.0)
|
||||
.build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
h.get_by_label("Convert to Diagram").click();
|
||||
h.run_steps(3);
|
||||
@@ -153,24 +122,8 @@ fn layout_gallery_shows_cached_pictures_and_previews_on_hover() {
|
||||
let mut s = Session::with_new();
|
||||
s.execute("slide.new", &json!({"layout": "blank"})).unwrap();
|
||||
s.execute("insert.smartArt", &json!({"kind": "process", "items": ["Plan", "Build", "Ship"]})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut h = harness_with(s, Services::default(), Harness::builder().with_size(egui::vec2(1600.0, 900.0)).with_step_dt(1.0 / 60.0), |_| {});
|
||||
h.state_mut().ui.tab = "SmartArt Design".into();
|
||||
=======
|
||||
let mut app = SlideApp::new(s, Services::default());
|
||||
app.ui.tab = "SmartArt Design".into();
|
||||
let mut h = Harness::builder()
|
||||
.with_context_setup(crate::framework::install_headless)
|
||||
.with_size(egui::vec2(1600.0, 900.0))
|
||||
.with_step_dt(1.0 / 60.0)
|
||||
.build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
h.get_by_role_and_label(egui::accesskit::Role::Button, "Layouts").click();
|
||||
h.run_steps(3);
|
||||
|
||||
@@ -17,24 +17,8 @@ fn thesaurus_pane_swaps_the_word_at_the_caret() {
|
||||
s.execute("text.edit", &json!({"id": id})).unwrap();
|
||||
s.execute("text.insert", &json!({"text": original})).unwrap();
|
||||
s.execute("text.edit", &json!({"id": id, "at": [0, 6]})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut h = crate::test_harness::harness(s, Services::default());
|
||||
h.state_mut().ui.tab = "Review".into();
|
||||
=======
|
||||
let mut app = SlideApp::new(s, Services::default());
|
||||
app.ui.tab = "Review".into();
|
||||
let mut h = Harness::builder()
|
||||
.with_context_setup(crate::framework::install_headless)
|
||||
.with_size(egui::vec2(1400.0, 900.0))
|
||||
.with_step_dt(1.0 / 60.0)
|
||||
.build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
h.get_by_label("Thesaurus").click();
|
||||
h.run_steps(3);
|
||||
|
||||
@@ -20,22 +20,9 @@ fn reflection_none_clears_after_a_second_preset() {
|
||||
s.execute("slide.new", &json!({"layout": "blank"})).unwrap();
|
||||
let id = s.execute("shape.insert", &json!({"preset": "rect", "rect": [72.0, 36.0, 144.0, 108.0]})).unwrap()["id"].as_u64().unwrap();
|
||||
s.execute("edit.select", &json!({"ids": [id]})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut h = crate::test_harness::harness_with(s, Services::default(), Harness::builder().with_size(egui::vec2(1400.0, 900.0)), |_| {});
|
||||
h.state_mut().ui.pane = Some("format".into());
|
||||
h.state_mut().ui.format_tab = "effects".into();
|
||||
=======
|
||||
let mut app = SlideApp::new(s, Services::default());
|
||||
app.ui.pane = Some("format".into());
|
||||
app.ui.format_tab = "effects".into();
|
||||
let mut h = Harness::builder().with_context_setup(crate::framework::install_headless).with_size(egui::vec2(1400.0, 900.0)).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
for preset in ["Tight", "Half", "Full"] {
|
||||
h.get_by_role_and_label(egui::accesskit::Role::RadioGroup, "Reflection").get_by_label(preset).click();
|
||||
@@ -46,36 +33,3 @@ fn reflection_none_clears_after_a_second_preset() {
|
||||
assert!(!has_reflection(&h), "None clears the {preset} reflection");
|
||||
}
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
#[test]
|
||||
fn reflection_none_stays_cleared_when_a_slider_only_had_focus() {
|
||||
let mut s = Session::with_new();
|
||||
s.execute("slide.new", &json!({"layout": "blank"})).unwrap();
|
||||
let id = s.execute("shape.insert", &json!({"preset": "rect", "rect": [72.0, 36.0, 144.0, 108.0]})).unwrap()["id"].as_u64().unwrap();
|
||||
s.execute("edit.select", &json!({"ids": [id]})).unwrap();
|
||||
let mut app = SlideApp::new(s, Services::default());
|
||||
app.ui.pane = Some("format".into());
|
||||
app.ui.format_tab = "effects".into();
|
||||
let mut h = Harness::builder().with_context_setup(crate::framework::install_headless).with_size(egui::vec2(1400.0, 900.0)).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
h.run_steps(3);
|
||||
h.get_by_label("Tight").click();
|
||||
h.run_steps(4);
|
||||
// Focus a reflection slider without editing it, then click "None": the slider's value must not
|
||||
// be written back over the cleared reflection.
|
||||
// The reflection's Size comes before the glow's (the same label).
|
||||
h.get_all_by_role_and_label(egui::accesskit::Role::Slider, "Size").next().unwrap().focus();
|
||||
h.run_steps(4);
|
||||
assert!(h.get_all_by_role_and_label(egui::accesskit::Role::Slider, "Size").next().unwrap().is_focused(), "the reflection size slider has focus");
|
||||
h.get_all_by_label("None").last().unwrap().click();
|
||||
h.run_steps(4);
|
||||
assert!(!has_reflection(&h), "a slider that only had focus does not re-add the reflection");
|
||||
}
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
|
||||
@@ -15,26 +15,8 @@ fn harness() -> Harness<'static, SlideApp> {
|
||||
s.execute("text.exit", &json!({})).unwrap();
|
||||
s.execute("format.font", &json!({"family": "Comic Neue"})).unwrap();
|
||||
s.execute("format.size", &json!({"size": 40})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let builder = Harness::builder().with_size(egui::vec2(1440.0, 900.0)).with_step_dt(1.0 / 60.0);
|
||||
let mut h = crate::test_harness::harness_with(s, Services::default(), builder, |_| {});
|
||||
=======
|
||||
let app = SlideApp::new(s, Services::default());
|
||||
// The product's default window. The Home ribbon overflows here with the bundled interface
|
||||
// fonts; the ribbon's own edge chevron must make its Editing group reachable instead of the
|
||||
// regression widening the fixture past the width the app actually opens at.
|
||||
let mut h = Harness::builder()
|
||||
.with_context_setup(crate::framework::install_headless)
|
||||
.with_size(egui::vec2(1440.0, 900.0))
|
||||
.with_step_dt(1.0 / 60.0)
|
||||
.build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
h
|
||||
}
|
||||
|
||||
@@ -24,33 +24,12 @@ fn deck_bytes(titles: &[&str]) -> Vec<u8> {
|
||||
fn harness(files: &Arc<ScriptedFiles>) -> Harness<'static, SlideApp> {
|
||||
let mut s = Session::with_new();
|
||||
s.execute("slide.new", &json!({"layout": "blank"})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let builder = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_step_dt(1.0 / 60.0);
|
||||
let files = Arc::clone(files);
|
||||
// PLAN: assumed sh.A11 harness_with(session, services, builder, adjust) -> Harness<'static, SlideApp> (shell-w11)
|
||||
let mut h = crate::test_harness::harness_with(s, Services::default(), builder, move |platform| {
|
||||
platform.host = platform.host.with_files(files);
|
||||
});
|
||||
=======
|
||||
let f = Rc::clone(file);
|
||||
let services = Services {
|
||||
pick_open: Some(Box::new(|_| Some("/tmp/src.deckcraft".to_string()))),
|
||||
read: Some(Box::new(move |_| Ok(f.borrow().clone()))),
|
||||
..Services::default()
|
||||
};
|
||||
let app = SlideApp::new(s, services);
|
||||
let mut h = Harness::builder()
|
||||
.with_context_setup(crate::framework::install_headless)
|
||||
.with_size(egui::vec2(1400.0, 900.0))
|
||||
.with_step_dt(1.0 / 60.0)
|
||||
.build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
h
|
||||
}
|
||||
|
||||
@@ -24,20 +24,8 @@ fn harness(select: &[usize]) -> (Harness<'static, SlideApp>, Vec<ShapeId>) {
|
||||
.collect();
|
||||
let picked: Vec<u32> = select.iter().map(|&i| ids[i].0).collect();
|
||||
s.execute("selection.select", &json!({"ids": picked})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut h = crate::test_harness::harness_with(s, Services::default(), Harness::builder().with_size(egui::vec2(1800.0, 900.0)), |_| {});
|
||||
h.state_mut().ui.tab = "Shape Format".into();
|
||||
=======
|
||||
let mut app = SlideApp::new(s, Services::default());
|
||||
app.ui.tab = "Shape Format".into();
|
||||
let mut h = Harness::builder().with_context_setup(crate::framework::install_headless).with_size(egui::vec2(1800.0, 900.0)).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
(h, ids)
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ fn table(h: &Harness<'_, SlideApp>) -> Option<(deckcraft_model::Table, deckcraft
|
||||
fn draw_a_table_split_it_and_erase_the_border() {
|
||||
let mut s = Session::with_new();
|
||||
s.execute("slide.new", &json!({"layout": "blank"})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut h = crate::test_harness::harness_with(
|
||||
s,
|
||||
Services::default(),
|
||||
@@ -41,21 +40,6 @@ fn draw_a_table_split_it_and_erase_the_border() {
|
||||
|_| {},
|
||||
);
|
||||
h.state_mut().ui.tab = "Insert".into();
|
||||
=======
|
||||
let mut app = SlideApp::new(s, Services::default());
|
||||
app.ui.tab = "Insert".into();
|
||||
let mut h = Harness::builder()
|
||||
.with_context_setup(crate::framework::install_headless)
|
||||
.with_size(egui::vec2(1400.0, 900.0))
|
||||
.with_step_dt(1.0 / 60.0)
|
||||
.build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
h.get_by_label("Table").click();
|
||||
h.run_steps(2);
|
||||
|
||||
@@ -14,7 +14,6 @@ fn pen_a_rectangle_then_ink_to_shape() {
|
||||
let _gpu = crate::gpu_lock::gpu_lock();
|
||||
let mut s = Session::with_new();
|
||||
s.execute("slide.new", &json!({"layout": "blank"})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut h = crate::test_harness::harness_with(
|
||||
s,
|
||||
Services::default(),
|
||||
@@ -22,21 +21,6 @@ fn pen_a_rectangle_then_ink_to_shape() {
|
||||
|_| {},
|
||||
);
|
||||
h.state_mut().ui.tab = "Draw".into();
|
||||
=======
|
||||
let mut app = SlideApp::new(s, Services::default());
|
||||
app.ui.tab = "Draw".into();
|
||||
let mut h = Harness::builder()
|
||||
.with_context_setup(crate::framework::install_headless)
|
||||
.with_size(egui::vec2(1400.0, 900.0))
|
||||
.with_step_dt(1.0 / 60.0)
|
||||
.build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
h.get_by_label("Black Pen").click();
|
||||
h.run_steps(2);
|
||||
|
||||
@@ -10,20 +10,9 @@ use serde_json::json;
|
||||
|
||||
use crate::{Services, SlideApp};
|
||||
|
||||
<<<<<<< HEAD
|
||||
fn harness(session: Session) -> Harness<'static, SlideApp> {
|
||||
let mut h = crate::test_harness::harness_with(session, Services::default(), Harness::builder().with_size(egui::vec2(1800.0, 900.0)), |_| {});
|
||||
h.state_mut().ui.tab = "Slide Master".into();
|
||||
=======
|
||||
fn harness(app: SlideApp) -> Harness<'static, SlideApp> {
|
||||
let mut h = Harness::builder().with_context_setup(crate::framework::install_headless).with_size(egui::vec2(1800.0, 900.0)).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
h
|
||||
}
|
||||
|
||||
@@ -19,20 +19,8 @@ fn picture_format(width: f32) -> Harness<'static, SlideApp> {
|
||||
let data = deckcraft_engine::cmd::base64_encode(&png);
|
||||
let id = s.execute("insert.picture", &json!({"data": data, "name": "a.png", "rect": [200, 100, 400, 250]})).unwrap()["id"].clone();
|
||||
s.execute("edit.select", &json!({"ids": [id]})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut h = crate::test_harness::harness_with(s, Services::default(), Harness::builder().with_size(egui::vec2(width, 900.0)), |_| {});
|
||||
h.state_mut().ui.tab = "Picture Format".into();
|
||||
=======
|
||||
let mut app = SlideApp::new(s, Services::default());
|
||||
app.ui.tab = "Picture Format".into();
|
||||
let mut h = Harness::builder().with_context_setup(crate::framework::install_headless).with_size(egui::vec2(width, 900.0)).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(4);
|
||||
h
|
||||
}
|
||||
|
||||
@@ -49,24 +49,9 @@ fn a_still_cursor_hides_over_a_clickable_shape() {
|
||||
let size = session.active().unwrap().doc.slide_size;
|
||||
let r = session.execute("shape.insert", &json!({"preset": "rect", "rect": [0.0, 0.0, size.width, size.height]})).unwrap();
|
||||
session.execute("insert.hyperlink", &json!({"url": "https://example.org", "ids": [r["id"]]})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut harness =
|
||||
harness_with(session, Services::default(), egui_kittest::Harness::builder().with_size(vec2(1000.0, 700.0)).with_step_dt(0.25), |_| {});
|
||||
harness.state_mut().ui.presenter_view = false;
|
||||
=======
|
||||
let app = SlideApp::new(session, crate::Services::default());
|
||||
let mut harness = egui_kittest::Harness::builder()
|
||||
.with_context_setup(crate::framework::install_headless)
|
||||
.with_size(vec2(1000.0, 700.0))
|
||||
.with_step_dt(0.25)
|
||||
.build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
harness.run_steps(3);
|
||||
harness.state_mut().start_show(0, false);
|
||||
harness.run_steps(2);
|
||||
@@ -117,27 +102,10 @@ fn keep_cursor_visible_leaves_a_still_cursor_over_a_link() {
|
||||
session.execute("slide.go", &json!({"index": 0})).unwrap();
|
||||
let r = session.execute("shape.insert", &json!({"preset": "rect", "rect": [0.0, 0.0, size.width, size.height]})).unwrap();
|
||||
session.execute("insert.hyperlink", &json!({"slide": 1, "ids": [r["id"]]})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut harness =
|
||||
harness_with(session, Services::default(), egui_kittest::Harness::builder().with_size(vec2(1000.0, 700.0)).with_step_dt(0.25), |_| {});
|
||||
harness.state_mut().ui.presenter_view = false;
|
||||
harness.state_mut().run("show.keepCursor", json!({"on": true})).unwrap();
|
||||
=======
|
||||
let mut app = SlideApp::new(session, crate::Services::default());
|
||||
app.ui.presenter_view = false;
|
||||
app.run("show.keepCursor", json!({"on": true})).unwrap();
|
||||
let mut harness = egui_kittest::Harness::builder()
|
||||
.with_context_setup(crate::framework::install_headless)
|
||||
.with_size(vec2(1000.0, 700.0))
|
||||
.with_step_dt(0.25)
|
||||
.build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
harness.run_steps(3);
|
||||
harness.state_mut().start_show(0, false);
|
||||
harness.run_steps(2);
|
||||
@@ -158,24 +126,12 @@ fn keep_cursor_visible_leaves_a_still_cursor_over_a_link() {
|
||||
fn set_up_slide_show_keeps_the_cursor_visible() {
|
||||
use egui_kittest::kittest::Queryable;
|
||||
|
||||
<<<<<<< HEAD
|
||||
let mut harness = harness_with(
|
||||
deckcraft_engine::Session::with_new(),
|
||||
Services::default(),
|
||||
egui_kittest::Harness::builder().with_size(vec2(1200.0, 800.0)),
|
||||
|_| {},
|
||||
);
|
||||
=======
|
||||
let app = SlideApp::new(deckcraft_engine::Session::with_new(), crate::Services::default());
|
||||
let mut harness =
|
||||
egui_kittest::Harness::builder().with_context_setup(crate::framework::install_headless).with_size(vec2(1200.0, 800.0)).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
for on in [true, false] {
|
||||
harness.state_mut().run("app.dialog", json!({"id": "setupShow"})).unwrap();
|
||||
harness.run_steps(6);
|
||||
@@ -283,26 +239,8 @@ fn show_with_clip() -> (egui_kittest::Harness<'static, SlideApp>, ShapeId, Pos2)
|
||||
})
|
||||
.unwrap();
|
||||
// Presenter view opens an embedded window over the whole screen here, which takes the clicks.
|
||||
<<<<<<< HEAD
|
||||
let mut harness = harness_with(session, Services::default(), egui_kittest::Harness::builder().with_size(size).with_step_dt(0.25), |_| {});
|
||||
harness.state_mut().ui.presenter_view = false;
|
||||
=======
|
||||
let mut app = SlideApp::new(session, crate::Services::default());
|
||||
app.ui.presenter_view = false;
|
||||
let mut harness =
|
||||
egui_kittest::Harness::builder().with_context_setup(crate::framework::install_headless).with_size(size).with_step_dt(0.25).build_ui_state(
|
||||
move |ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
if let (Some(show), Some(d)) = (app.show.as_ref(), app.session.active()) {
|
||||
let now = ui.input(|i| i.time);
|
||||
seen.set(pointer_on_media_bar(ui.ctx(), ui, &d.doc, show, now));
|
||||
slide_seen.set(shown_slide_rect(ui, show, &d.doc));
|
||||
}
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
harness.run_steps(3);
|
||||
harness.state_mut().start_show(0, false);
|
||||
harness.run_steps(2);
|
||||
@@ -390,30 +328,9 @@ fn show_with_gif() -> (egui_kittest::Harness<'static, SlideApp>, ShapeId, Pos2)
|
||||
Ok(())
|
||||
})
|
||||
.unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut harness =
|
||||
harness_with(session, Services::default(), egui_kittest::Harness::builder().with_size(vec2(1000.0, 700.0)).with_step_dt(0.25), |_| {});
|
||||
harness.state_mut().ui.presenter_view = false;
|
||||
=======
|
||||
let slide = std::rc::Rc::new(std::cell::Cell::new(Rect::NOTHING));
|
||||
let slide_seen = slide.clone();
|
||||
let mut app = SlideApp::new(session, crate::Services::default());
|
||||
app.ui.presenter_view = false;
|
||||
let mut harness = egui_kittest::Harness::builder()
|
||||
.with_context_setup(crate::framework::install_headless)
|
||||
.with_size(vec2(1000.0, 700.0))
|
||||
.with_step_dt(0.25)
|
||||
.build_ui_state(
|
||||
move |ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
if let (Some(show), Some(d)) = (app.show.as_ref(), app.session.active()) {
|
||||
slide_seen.set(shown_slide_rect(ui, show, &d.doc));
|
||||
}
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
harness.run_steps(3);
|
||||
harness.state_mut().start_show(1, false);
|
||||
harness.run_steps(2);
|
||||
@@ -520,21 +437,8 @@ fn slideshow_navigation_advances_once_with_presenter_view() {
|
||||
let mut session = deckcraft_engine::Session::with_new();
|
||||
session.execute("slide.new", &json!({})).unwrap();
|
||||
session.execute("slide.new", &json!({})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut harness = harness_with(session, Services::default(), egui_kittest::Harness::builder().with_size(vec2(1000.0, 700.0)), |_| {});
|
||||
harness.state_mut().ui.presenter_view = true;
|
||||
=======
|
||||
let mut app = SlideApp::new(session, crate::Services::default());
|
||||
app.ui.presenter_view = true;
|
||||
let mut harness =
|
||||
egui_kittest::Harness::builder().with_context_setup(crate::framework::install_headless).with_size(vec2(1000.0, 700.0)).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
harness.run_steps(3);
|
||||
harness.state_mut().start_show(0, false);
|
||||
harness.run_steps(2);
|
||||
@@ -830,25 +734,9 @@ fn show_of_three() -> egui_kittest::Harness<'static, SlideApp> {
|
||||
let mut session = deckcraft_engine::Session::with_new();
|
||||
session.execute("slide.new", &json!({})).unwrap();
|
||||
session.execute("slide.new", &json!({})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut harness =
|
||||
harness_with(session, Services::default(), egui_kittest::Harness::builder().with_size(vec2(1000.0, 700.0)).with_step_dt(1.0 / 60.0), |_| {});
|
||||
harness.state_mut().ui.presenter_view = false;
|
||||
=======
|
||||
let mut app = SlideApp::new(session, crate::Services::default());
|
||||
app.ui.presenter_view = false;
|
||||
let mut harness = egui_kittest::Harness::builder()
|
||||
.with_context_setup(crate::framework::install_headless)
|
||||
.with_size(vec2(1000.0, 700.0))
|
||||
.with_step_dt(1.0 / 60.0)
|
||||
.build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
harness.run_steps(3);
|
||||
harness.state_mut().start_show(0, false);
|
||||
harness.run_steps(2);
|
||||
@@ -1166,21 +1054,9 @@ fn back_leaves_a_slide_whose_first_animation_is_with_previous() {
|
||||
session
|
||||
.execute("animation.add", &json!({"effect": "fade", "class": "entrance", "ids": [id.0], "start": "withPrevious", "duration": 500}))
|
||||
.unwrap();
|
||||
<<<<<<< HEAD
|
||||
// PLAN: plan error: the kept Back animation trial needs 0.25 s steps to finish its entrance in eight steps.
|
||||
let mut harness =
|
||||
harness_with(session, Services::default(), egui_kittest::Harness::builder().with_size(vec2(1000.0, 700.0)).with_step_dt(0.25), |_| {});
|
||||
=======
|
||||
let app = SlideApp::new(session, crate::Services::default());
|
||||
let mut harness =
|
||||
egui_kittest::Harness::builder().with_context_setup(crate::framework::install_headless).with_size(vec2(1000.0, 700.0)).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
harness.run_steps(3);
|
||||
harness.state_mut().start_show(0, false);
|
||||
harness.run_steps(2);
|
||||
@@ -1305,23 +1181,9 @@ fn remote_presenter_uses_the_audience_state_and_closes_with_the_show() {
|
||||
let mut session = deckcraft_engine::Session::with_new();
|
||||
session.execute("slide.new", &json!({})).unwrap();
|
||||
session.execute("slide.new", &json!({})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let services = Services { presenter: Some(Box::new(Mock(bridge.clone()))) };
|
||||
let mut h = harness_with(session, services, egui_kittest::Harness::builder().with_size(vec2(1000.0, 700.0)), |_| {});
|
||||
h.state_mut().ui.presenter_view = true;
|
||||
=======
|
||||
let services = crate::Services { presenter: Some(Box::new(Mock(bridge.clone()))), ..Default::default() };
|
||||
let mut app = SlideApp::new(session, services);
|
||||
app.ui.presenter_view = true;
|
||||
let mut h =
|
||||
egui_kittest::Harness::builder().with_context_setup(crate::framework::install_headless).with_size(vec2(1000.0, 700.0)).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
h.state_mut().start_show(0, false);
|
||||
let ctx = h.ctx.clone();
|
||||
|
||||
@@ -18,21 +18,12 @@ fn open_with_size(w: f64, h: f64) -> egui_kittest::Harness<'static, SlideApp> {
|
||||
let mut s = Session::new();
|
||||
s.execute("file.open", &json!({"path": path.to_string_lossy()})).unwrap();
|
||||
let _ = std::fs::remove_file(&path);
|
||||
<<<<<<< HEAD
|
||||
|
||||
crate::test_harness::harness_with(
|
||||
s,
|
||||
Services::default(),
|
||||
egui_kittest::Harness::<SlideApp>::builder().with_size(egui::vec2(1280.0, 800.0)).with_step_dt(1.0 / 60.0),
|
||||
|_| {},
|
||||
=======
|
||||
egui_kittest::Harness::builder().with_context_setup(crate::framework::install_headless).with_size(egui::vec2(1280.0, 800.0)).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
SlideApp::new(s, Services::default()),
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ fn harness(with_sections: bool) -> Harness<'static, Framed> {
|
||||
s.execute("section.add", &json!({"name": "Alpha", "at": 0})).unwrap();
|
||||
s.execute("section.add", &json!({"name": "Beta", "at": 2})).unwrap();
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
let mut h = crate::test_harness::harness_framed(
|
||||
s,
|
||||
Services::default(),
|
||||
@@ -36,21 +35,6 @@ fn harness(with_sections: bool) -> Harness<'static, Framed> {
|
||||
},
|
||||
);
|
||||
h.state_mut().ui.view = crate::ViewMode::Sorter;
|
||||
=======
|
||||
let mut app = SlideApp::new(s, Services::default());
|
||||
app.ui.view = crate::ViewMode::Sorter;
|
||||
let mut h = Harness::builder()
|
||||
.with_context_setup(crate::framework::install_headless)
|
||||
.with_size(egui::vec2(1400.0, 900.0))
|
||||
.with_step_dt(1.0 / 60.0)
|
||||
.build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
h
|
||||
}
|
||||
|
||||
@@ -21,20 +21,8 @@ fn harness(tab: &str) -> (Harness<'static, SlideApp>, [ShapeId; 2]) {
|
||||
ids[i] = ShapeId(r["id"].as_u64().unwrap() as u32);
|
||||
}
|
||||
s.execute("selection.select", &json!({"ids": [ids[0].0, ids[1].0]})).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut h = crate::test_harness::harness_with(s, Services::default(), Harness::builder().with_size(egui::vec2(1800.0, 900.0)), |_| {});
|
||||
h.state_mut().ui.tab = tab.into();
|
||||
=======
|
||||
let mut app = SlideApp::new(s, Services::default());
|
||||
app.ui.tab = tab.into();
|
||||
let mut h = Harness::builder().with_context_setup(crate::framework::install_headless).with_size(egui::vec2(1800.0, 900.0)).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
(h, ids)
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,19 +10,6 @@ use crate::show::commands::{ShowCommands, ShowWindow, run_command};
|
||||
use crate::test_harness::harness_with;
|
||||
use deckcraft_engine::Session;
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
fn harness(session: Session, size: egui::Vec2) -> egui_kittest::Harness<'static, SlideApp> {
|
||||
egui_kittest::Harness::builder().with_context_setup(crate::framework::install_headless).with_size(size).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
SlideApp::new(session, Services::default()),
|
||||
)
|
||||
}
|
||||
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
/// The tallest slide allowed (1 × 56): its thumbnails and presenter-view preview are tens of
|
||||
/// thousands of pixels high at their usual widths.
|
||||
fn tall_deck() -> Session {
|
||||
|
||||
@@ -71,20 +71,8 @@ const KEYS: &[Key] = &[
|
||||
fn harness() -> Harness<'static, SlideApp> {
|
||||
let mut s = Session::new();
|
||||
deckcraft_engine::sample::open_sample(&mut s).unwrap();
|
||||
<<<<<<< HEAD
|
||||
let mut h =
|
||||
crate::test_harness::harness_with(s, crate::Services::default(), Harness::builder().with_size(vec2(W, H)).with_step_dt(1.0 / 60.0), |_| {});
|
||||
=======
|
||||
let app = SlideApp::new(s, Services::default());
|
||||
let mut h =
|
||||
Harness::builder().with_context_setup(crate::framework::install_headless).with_size(vec2(W, H)).with_step_dt(1.0 / 60.0).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
);
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
h.run_steps(3);
|
||||
h
|
||||
}
|
||||
|
||||
@@ -11,19 +11,8 @@ use crate::{Services, SlideApp};
|
||||
use deckcraft_engine::Session;
|
||||
use deckcraft_geom::Unit;
|
||||
|
||||
<<<<<<< HEAD
|
||||
fn harness(session: Session) -> Harness<'static, SlideApp> {
|
||||
crate::test_harness::harness(session, Services::default())
|
||||
=======
|
||||
fn harness(app: SlideApp) -> Harness<'static, SlideApp> {
|
||||
Harness::builder().with_context_setup(crate::framework::install_headless).with_size(egui::vec2(1400.0, 900.0)).build_ui_state(
|
||||
|ui, app: &mut SlideApp| {
|
||||
app.logic(ui.ctx());
|
||||
app.ui(ui);
|
||||
},
|
||||
app,
|
||||
)
|
||||
>>>>>>> b6dd921b46498082f4f451673ff694ee83413c08
|
||||
}
|
||||
|
||||
/// A blank slide with one 2" x 1.5" rectangle at (1", 0.5"), selected.
|
||||
|
||||
Reference in New Issue
Block a user