Files
brave-core/browser/ai_chat
Netzenbot 9c8462ef86 Fix test: AIChatConversationTaskBrowserTest.TaskUI (#34754)
* Fix test: AIChatConversationTaskBrowserTest.TaskUI

The Leo Button component (SvelteToReact wrapper) attaches its click event
listener asynchronously via useEffect, after browser paint. On macOS, the
paint can be delayed enough that the click listener is not yet attached when
ClickElement fires, causing pauseTask() to never be called and the RunUntil
for kPaused to time out.

Fix by calling conversation_handler_->PauseTask() directly instead of going
through the UI click path. The direct C++ call is reliable and synchronous,
eliminating the timing window. The UI click path is already tested by
TaskPauseResumeActions.

Resolves https://github.com/brave/brave-browser/issues/53695

* Address review: add TODO for SvelteToReact async listener issue

Updated workaround comment to accurately describe the root cause:
the SvelteToReact wrapper in @brave/leo attaches click listeners
asynchronously via useEffect. Filed brave/leo#1343 to fix it at
the source, and added a TODO referencing that issue.
2026-04-01 10:18:32 -04:00
..
2025-12-01 22:21:46 +01:00