Files
brave-core/browser
Netzenbot 79cc97c87f Fix test: AIChatConversationTaskBrowserTest.TaskPauseResumeActions (#33517)
Fix intermittent test failure caused by race condition between
tool execution completion and pause button click timing.

The original test used the real navigation tool which executes
asynchronously. If navigation completed before the pause button
was clicked, GenerateAssistantResponse would be called, violating
the Times(0) expectation.

Fix by using a MockTool that captures its callback, allowing the
test to control exactly when the tool execution completes. The
tool now completes after pause is clicked, verifying that
generation is correctly skipped while paused.

Key changes:
- Replace navigation tool with MockTool for controlled timing
- Capture tool callback and complete it after pause
- Verify generation is skipped while in paused state
- Remove tab-related checks that don't apply with mock tool

Resolves brave/brave-browser#51130
2026-02-03 07:41:16 -05:00
..
2026-01-29 13:40:34 -05:00