From patchwork Mon Sep 15 12:28:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 338 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757939441; bh=IUKHdnE3IscMDoabFCX5n97u68EP6Aiah5ptta1tRJ8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Wx1aWQB9ibtIiSKPIEeyB18vwwn2TwUUnlc60Lp91D2Pu6DKwDNXU4hvTbX77K5iV rgYo1KKzPZZMlhI//2e0UTUN+0ybhemzdkW+YrnjEfRbGgIViQpC1WnfPvKvmbyxWO BNQ+j3X/37zx7nfczKIuXxCFNzzo8NZm/9AXRmVXVZtsfBeq/YEFbmZEjHkI5NOAYj IaJiGroZFE9ayQNXkNI3Avw/qLvWe/4hNXubqIJR/VwzI7UcLhrcMeB4PcEFUuMrj9 WIrHCaQixrtQtE63ONhhjnmG1vSG0LDt1Q/IGIh1+HUncvA7REfSqV+annONif5YvH 33sH+mhgwMQ8A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3DE3667BD5 for ; Mon, 15 Sep 2025 06:30:41 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 5RWVP3oCLRGF for ; Mon, 15 Sep 2025 06:30:41 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757939441; bh=IUKHdnE3IscMDoabFCX5n97u68EP6Aiah5ptta1tRJ8=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Wx1aWQB9ibtIiSKPIEeyB18vwwn2TwUUnlc60Lp91D2Pu6DKwDNXU4hvTbX77K5iV rgYo1KKzPZZMlhI//2e0UTUN+0ybhemzdkW+YrnjEfRbGgIViQpC1WnfPvKvmbyxWO BNQ+j3X/37zx7nfczKIuXxCFNzzo8NZm/9AXRmVXVZtsfBeq/YEFbmZEjHkI5NOAYj IaJiGroZFE9ayQNXkNI3Avw/qLvWe/4hNXubqIJR/VwzI7UcLhrcMeB4PcEFUuMrj9 WIrHCaQixrtQtE63ONhhjnmG1vSG0LDt1Q/IGIh1+HUncvA7REfSqV+annONif5YvH 33sH+mhgwMQ8A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2D77667B44 for ; Mon, 15 Sep 2025 06:30:41 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757939440; bh=4i3BgKyqbLsiUl6ZtrsSxPiTAmA8uhgOjpOxYXO4Ho8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UK3JyGICrEOPrxpjZrb/v3WOCmet/98SbfsPpzInUapPECl4PDcqGM5BezCpwwR+3 g1uZ9G8JPhnILvv7UPikOYFvpqZWNfgm7u4rUIdIxxjx1a70o0rru+TZS8r7Bt5YsH KNIA1nuwMbP3xKf1MsZjYrZNeJ66wAoershiN0PD9L4+BcNbYf4rGBE2q3v1QxRyJg GEkBV+u9DvKm3HtB9rpjSB3uS+94HddaMVg3KvzH20OiqcCM3GJOVCSz3KuDhifI5t 7zc/apzawOzkBpqdTG+qDgkL92IpgJ7QhbOhAWy9OFeZ5MpzN3oXQBvxlc+iJ+WHw+ HW8CQq3dQSzFQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 360AE67A04; Mon, 15 Sep 2025 06:30:40 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id 1qQMsjq_9ftx; Mon, 15 Sep 2025 06:30:40 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757939436; bh=BZbxwfWomzTr9nV3yMHAJcTdzCnNIoJBH39OPzOyxGo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LViJaDjclKpQdwFozr/+WGafDHlAvTq74bcukM+67gPibTBBIQxOFcCOKvGr8LcZR s+1YeML2snqUGLBAvB+ymEFbZIBDAY5pHgQRUykUSlTxD450gv2lNUqfv+YZ+BOIkV F7fEQ6J6VOf2xskc/Gha8pVHWwknHLJHQyeR8X5Jt25b4fQwer8mNmj7hImIiILeoo oSBXUcZhwZVmK00af95S4XyJYc4fD/Im03FRBYcAgL7l6Hwpqwoiun+U17GR/RDBMN 5Pvqo3Hdqt16E5yrR6A01l/E++Dp5wh+p9lVNHVYjVKxIABDlaucOVgn5vU+L+dBsk tzrriIdWHBqPw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E0F9167B34; Mon, 15 Sep 2025 06:30:35 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 15 Sep 2025 06:28:56 -0600 Message-ID: <20250915122905.1217249-24-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250915122905.1217249-1-sjg@u-boot.org> References: <20250915122905.1217249-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: K3V6B4UY6KXJ6JNPA7CMLGQDTQU2D54D X-Message-ID-Hash: K3V6B4UY6KXJ6JNPA7CMLGQDTQU2D54D X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 23/23] expo: Provide a test of expo mouse behaviour List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Check the behaviour of non-popup menus with a mouse. Signed-off-by: Simon Glass --- test/boot/expo.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/test/boot/expo.c b/test/boot/expo.c index 21bfd8e586b..7723a301c9f 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -1046,8 +1046,54 @@ static int expo_mouse_enable(struct unit_test_state *uts) ut_assertnonnull(exp->mouse); ut_asserteq(UCLASS_MOUSE, device_get_uclass_id(exp->mouse)); + return 0; +} +BOOTSTD_TEST(expo_mouse_enable, UTF_DM | UTF_SCAN_FDT); + +/* Check mouse click functionality */ +static int expo_mouse_click(struct unit_test_state *uts) +{ + struct scene_obj_menu *menu; + struct abuf buf, logo_copy; + struct expo_action act; + struct scene *scn; + struct expo *exp; + + ut_assertok(create_test_expo(uts, &exp, &scn, &menu, &buf, &logo_copy)); + + /* set the scene */ + ut_assertok(expo_set_scene_id(exp, SCENE1)); + + /* arrange the scene so objects have proper bounding boxes */ + ut_assertok(scene_arrange(scn)); + + /* enable mouse input */ + ut_assertok(expo_set_mouse_enable(exp, true)); + + /* click on the first menu-item label */ + ut_assertok(click_check(uts, scn, ITEM1_LABEL, EXPOACT_SELECT, &act)); + ut_asserteq(EXPOACT_SELECT, act.type); + ut_asserteq(ITEM1, act.select.id); + + /* click on the second menu-item label */ + ut_assertok(click_check(uts, scn, ITEM2_LABEL, EXPOACT_SELECT, &act)); + ut_asserteq(EXPOACT_SELECT, act.type); + ut_asserteq(ITEM2, act.select.id); + + /* click on the second menu-item description */ + ut_assertok(click_check(uts, scn, ITEM2_DESC, EXPOACT_SELECT, &act)); + ut_asserteq(EXPOACT_SELECT, act.type); + ut_asserteq(ITEM2, act.select.id); + + /* click in empty space */ + ut_assertok(scene_send_click(scn, 10, 10, &act)); + ut_asserteq(EXPOACT_NONE, act.type); + + abuf_uninit(&buf); + abuf_uninit(&logo_copy); + expo_destroy(exp); return 0; } -BOOTSTD_TEST(expo_mouse_enable, UTF_DM | UTF_SCAN_FDT); +BOOTSTD_TEST(expo_mouse_click, UTF_DM | UTF_SCAN_FDT);