From e57c0a47a74ff404a9f6507939d2fa95ec6595a3 Mon Sep 17 00:00:00 2001 From: lixianjing Date: Sun, 12 Nov 2023 17:42:22 +0800 Subject: [PATCH] improve ui auto test --- demos/demo_ui_old_app.c | 8 +- design/default/ui/main.xml | 2 +- docs/changes.md | 13 + res/assets/default/inc/ui/images.data | 484 +++++++-------- res/assets/default/inc/ui/main.data | 564 +++++++++--------- res/assets/default/raw/ui/images.bin | Bin 7174 -> 7175 bytes res/assets/default/raw/ui/main.bin | Bin 6582 -> 6584 bytes run_ui_test.sh | 26 + src/base/widget.c | 35 +- src/remote_ui/client/remote_ui.c | 190 ++++-- src/remote_ui/client/remote_ui.h | 98 ++- src/remote_ui/service/remote_ui_service.c | 331 +++++++--- src/remote_ui/shared/remote_ui_types_def.h | 201 ++----- src/service/client.c | 14 +- src/service/msg_header.h | 78 +-- src/service/service.c | 24 +- tests/ui_test_data/demo_ui_old.ini | 68 --- tests/ui_test_data/demo_ui_old_get_source.ini | 15 - .../demo_ui_old_send_click_events.ini | 19 - .../demo_ui_old_send_key_events.ini | 19 - .../ui_test_data/demo_ui_old_set_get_prop.ini | 21 - .../demo_ui_old_set_theme_language.ini | 17 - tests/ui_test_data/demouiold/basic.ini | 64 ++ tests/ui_test_data/demouiold/button.ini | 45 ++ .../confirm.ini} | 0 .../ui_test_data/demouiold/create_widget.ini | 18 + .../ui_test_data/demouiold/create_window.ini | 28 + tests/ui_test_data/demouiold/data/foo.json | 17 + tests/ui_test_data/demouiold/data/foo.xml | 55 ++ tests/ui_test_data/demouiold/data/fscript.fs | 2 + .../demouiold/data/loaded_assets_info.txt | 4 + .../demouiold/data/loaded_image_info.txt | 21 + tests/ui_test_data/demouiold/data/main.png | Bin 0 -> 45065 bytes .../demouiold/data/main_source.xml | 127 ++++ tests/ui_test_data/demouiold/data/quit.xml | 1 + tests/ui_test_data/demouiold/edit.ini | 89 +++ .../exec_fscript.ini} | 11 +- tests/ui_test_data/demouiold/fps.ini | 34 ++ .../demouiold/get_loaded_assets_info.ini | 6 + .../demouiold/get_loaded_image_info.ini | 7 + .../info.ini} | 0 tests/ui_test_data/demouiold/keyboard.ini | 14 + tests/ui_test_data/demouiold/language.ini | 49 ++ .../ui_test_data/demouiold/main_snapshot.ini | 7 + tests/ui_test_data/demouiold/main_source.ini | 7 + tests/ui_test_data/demouiold/max_fps.ini | 29 + tests/ui_test_data/demouiold/overlay.ini | 34 ++ tests/ui_test_data/demouiold/screen_saver.ini | 38 ++ .../demouiold/send_key_events.ini | 53 ++ .../send_pointer_events.ini} | 9 - tests/ui_test_data/demouiold/theme.ini | 28 + .../toast.ini} | 0 .../warn.ini} | 0 tools/ui_test/README.md | 538 +++++++++++++++++ tools/ui_test/ui_test.c | 182 +++++- 55 files changed, 2668 insertions(+), 1076 deletions(-) create mode 100755 run_ui_test.sh delete mode 100644 tests/ui_test_data/demo_ui_old.ini delete mode 100644 tests/ui_test_data/demo_ui_old_get_source.ini delete mode 100644 tests/ui_test_data/demo_ui_old_send_click_events.ini delete mode 100644 tests/ui_test_data/demo_ui_old_send_key_events.ini delete mode 100644 tests/ui_test_data/demo_ui_old_set_get_prop.ini delete mode 100644 tests/ui_test_data/demo_ui_old_set_theme_language.ini create mode 100644 tests/ui_test_data/demouiold/basic.ini create mode 100644 tests/ui_test_data/demouiold/button.ini rename tests/ui_test_data/{demo_ui_old_confirm.ini => demouiold/confirm.ini} (100%) create mode 100644 tests/ui_test_data/demouiold/create_widget.ini create mode 100644 tests/ui_test_data/demouiold/create_window.ini create mode 100644 tests/ui_test_data/demouiold/data/foo.json create mode 100644 tests/ui_test_data/demouiold/data/foo.xml create mode 100644 tests/ui_test_data/demouiold/data/fscript.fs create mode 100644 tests/ui_test_data/demouiold/data/loaded_assets_info.txt create mode 100644 tests/ui_test_data/demouiold/data/loaded_image_info.txt create mode 100644 tests/ui_test_data/demouiold/data/main.png create mode 100644 tests/ui_test_data/demouiold/data/main_source.xml create mode 100644 tests/ui_test_data/demouiold/data/quit.xml create mode 100644 tests/ui_test_data/demouiold/edit.ini rename tests/ui_test_data/{demo_ui_old_exec_fscript.ini => demouiold/exec_fscript.ini} (52%) create mode 100644 tests/ui_test_data/demouiold/fps.ini create mode 100644 tests/ui_test_data/demouiold/get_loaded_assets_info.ini create mode 100644 tests/ui_test_data/demouiold/get_loaded_image_info.ini rename tests/ui_test_data/{demo_ui_old_info.ini => demouiold/info.ini} (100%) create mode 100644 tests/ui_test_data/demouiold/keyboard.ini create mode 100644 tests/ui_test_data/demouiold/language.ini create mode 100644 tests/ui_test_data/demouiold/main_snapshot.ini create mode 100644 tests/ui_test_data/demouiold/main_source.ini create mode 100644 tests/ui_test_data/demouiold/max_fps.ini create mode 100644 tests/ui_test_data/demouiold/overlay.ini create mode 100644 tests/ui_test_data/demouiold/screen_saver.ini create mode 100644 tests/ui_test_data/demouiold/send_key_events.ini rename tests/ui_test_data/{demo_ui_old_send_pointer_events.ini => demouiold/send_pointer_events.ini} (79%) create mode 100644 tests/ui_test_data/demouiold/theme.ini rename tests/ui_test_data/{demo_ui_old_toast.ini => demouiold/toast.ini} (100%) rename tests/ui_test_data/{demo_ui_old_warn.ini => demouiold/warn.ini} (100%) create mode 100644 tools/ui_test/README.md diff --git a/demos/demo_ui_old_app.c b/demos/demo_ui_old_app.c index 3e0ed125a..d3d9707ca 100644 --- a/demos/demo_ui_old_app.c +++ b/demos/demo_ui_old_app.c @@ -1417,12 +1417,10 @@ ret_t application_init() { fs_get_user_storage_path(os_fs(), path); log_debug("user storage path:%s\n", path); -#ifndef REMOTE_UI_URL -#define REMOTE_UI_URL "tcp://localhost:2233" -#endif/*REMOTE_UI_URL*/ - +#ifdef TK_IS_PC tk_service_start(main_loop_get_event_source_manager(main_loop()), REMOTE_UI_URL, remote_ui_service_create, NULL); - +#endif/*TK_IS_PC*/ + return show_preload_res_window(); } diff --git a/design/default/ui/main.xml b/design/default/ui/main.xml index ffa9d36ec..7cbe102d1 100644 --- a/design/default/ui/main.xml +++ b/design/default/ui/main.xml @@ -2,7 +2,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/ui_test_data/demouiold/data/quit.xml b/tests/ui_test_data/demouiold/data/quit.xml new file mode 100644 index 000000000..bd1c60bf7 --- /dev/null +++ b/tests/ui_test_data/demouiold/data/quit.xml @@ -0,0 +1 @@ +