Files
brave-core/browser/speedreader
Netzenbot fde87ff06e Fix test: SpeedReaderBrowserTest.EnableDisableSpeedreaderB (#33551)
Replace infinite polling loops with base::test::RunUntil() to prevent
test timeouts. The WaitDistilled(), WaitDistillable(), WaitOriginal(),
and WaitToolbarVisibility() functions used NonBlockingDelay() in
infinite while loops, which could run forever if the expected state
was never reached.

Using base::test::RunUntil() provides a built-in 1-second timeout and
returns false on timeout, allowing tests to fail gracefully instead of
hanging indefinitely. This addresses the intermittent timeout failures
in SpeedReaderBrowserTest.EnableDisableSpeedreaderB.

Also modernize the ShowOriginalPage test to use base::test::RunUntil()
instead of the old NonBlockingDelay() polling pattern when waiting for
the "View original" link to appear in the DOM. This maintains consistency
with the helper function improvements.

Fixes: brave/brave-browser#51693
2026-02-02 21:58:12 -05:00
..