Skip to content

Commit

Permalink
testlib: Force page loading with Chromium 119
Browse files Browse the repository at this point in the history
The same "browser optimizes away page loads" behaviour that we fixed for
Firefox in commit 49ee017 now also affects Chromium 119.
Unfortunately that does not have a working `Page.navigate` option to
force a page load. So force it by navigating to the blank page first.
  • Loading branch information
martinpitt committed Nov 20, 2023
1 parent 405f6c0 commit d9e56a3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/common/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ def open(self, href: str, cookie: Optional[Dict[str, str]] = None, tls: bool = F
# Force a reload in this case, to make tests and the waitPageLoad below predictable
# But that option has the inverse effect with Chromium (argh)
opts["transitionType"] = "reload"
elif self.cdp.browser.name == 'chromium':
# Chromium also optimizes this away, but doesn't have a knob to force loading
# so load the blank page first
self.cdp.invoke("Page.navigate", url="about:blank")
self.cdp.invoke("waitPageLoad", timeout=5)
self.cdp.invoke("Page.navigate", url=href, **opts)
self.cdp.invoke("waitPageLoad", timeout=self.cdp.timeout)

Expand Down

0 comments on commit d9e56a3

Please sign in to comment.