Fix intermittent SpeedReaderBrowserTest.ShowOriginalPage failure (#35718)

WaitDistilled() was called without checking its return value.
If distillation times out or fails, the state doesn't reach
Distilled, but the test proceeds to look for a DOM element
that only exists in distilled HTML, resulting in a misleading
timeout error.

All other calls to WaitDistilled() in this file use
ASSERT_TRUE(WaitDistilled()), which catches the failure early
with a clear error message.

Resolves brave/brave-browser#54582
This commit is contained in:
Netzenbot
2026-04-24 14:35:12 -04:00
committed by GitHub
parent a19a5e7051
commit ab9a290516
@@ -652,8 +652,7 @@ IN_PROC_BROWSER_TEST_F(SpeedReaderBrowserTest, ReloadContent) {
IN_PROC_BROWSER_TEST_F(SpeedReaderBrowserTest, ShowOriginalPage) {
EnableSpeedreaderAllowedForAllSites();
NavigateToPageSynchronously(kTestPageReadable);
// Wait for distillation to complete before interacting with distilled content
WaitDistilled();
ASSERT_TRUE(WaitDistilled());
auto* web_contents = ActiveWebContents();
static constexpr char kCheckNoApiInMainWorld[] =