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 | |
5 | component TextInner inherits Text { |
6 | callback panic(); |
7 | //init => { self.panic() } |
8 | text: "Click me" ; |
9 | TouchArea { |
10 | clicked => { root.panic(); } |
11 | } |
12 | } |
13 | |
14 | component TextOuter { |
15 | callback panic <=> inner.panic; |
16 | inner := TextInner { |
17 | width: 100%; |
18 | height: 100%; |
19 | } |
20 | } |
21 | |
22 | export component TestCase inherits Window { |
23 | width: 300px; |
24 | height: 300px; |
25 | TextOuter { |
26 | } |
27 | } |
28 | |
29 | /* |
30 | ```cpp |
31 | auto handle = TestCase::create(); |
32 | const TestCase &instance = *handle; |
33 | slint_testing::send_mouse_click(&instance, 50., 50.); |
34 | ``` |
35 | |
36 | ```rust |
37 | let instance = TestCase::new().unwrap(); |
38 | slint_testing::send_mouse_click(&instance, 50., 50.); |
39 | ``` |
40 | |
41 | ```js |
42 | var instance = new slint.TestCase(); |
43 | slintlib.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 | } |