1#![allow(deprecated)]slint::slint!{#[include_path=r#"/input/slint/tests/driver/driverlib/../../cases/crashes"#]
2// Copyright © SixtyFPS GmbH <info@slint.dev>
3// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
4
5component TextInner inherits Text {
6 callback panic();
7 //init => { self.panic() }
8 text: "Click me";
9 TouchArea {
10 clicked => { root.panic(); }
11 }
12}
13
14component TextOuter {
15 callback panic <=> inner.panic;
16 inner := TextInner {
17 width: 100%;
18 height: 100%;
19 }
20}
21
22export component TestCase inherits Window {
23 width: 300px;
24 height: 300px;
25 TextOuter {
26 }
27}
28
29/*
30```cpp
31auto handle = TestCase::create();
32const TestCase &instance = *handle;
33slint_testing::send_mouse_click(&instance, 50., 50.);
34```
35
36```rust
37let instance = TestCase::new().unwrap();
38slint_testing::send_mouse_click(&instance, 50., 50.);
39```
40
41```js
42var instance = new slint.TestCase();
43slintlib.private_api.send_mouse_click(instance, 50., 50.);
44```
45*/
46}
47
48#[test] fn t_0() -> std::result::Result<(), std::boxed::Box<dyn std::error::Error>> {
49 use i_slint_backend_testing as slint_testing;
50 slint_testing::init();
51 let instance = TestCase::new().unwrap();
52 slint_testing::send_mouse_click(&instance, x:50., y:50.);
53 Ok(())
54}