A platform for community discussion. Free, open, simple.
PERF: Avoid internal Chromium pages during browser tests (#44996)
Alan Guo Xiang Tan407ee01cbbb0
diff --git a/spec/support/system/driver.rb b/spec/support/system/driver.rbindex 32601a0d560..f6d3efd94a7 100644--- a/spec/support/system/driver.rb+++ b/spec/support/system/driver.rb@@ -133,8 +133,41 @@ module SystemDriversenddef self.apply_base_chrome_args(args = [], allow_network: [])- base_args = %w[+ # A custom --disable-features replaces the generated list. Keep the browser+ # safeguards relevant to Chromium in our Linux test image alongside our flags.+ disabled_features = [+ # Avoid Google AI Mode eligibility requests during browser startup.+ "AimEnabled",+ # Avoid headed about:blank navigation hangs.+ # https://github.com/microsoft/playwright/issues/14047+ "AvoidUnnecessaryBeforeUnloadCheckSync",+ # Keep the profile alive when examples close and replace the last browser window.+ "DestroyProfileOnBrowserClose",+ # Keep HTTP test URLs on HTTP instead of attempting automatic HTTPS upgrades.+ "HttpsUpgrades",+ # Avoid casting device discovery and its local network traffic in the test container.+ "MediaRouter",+ # Avoid startup requests to Google network time servers.+ "NetworkTimeServiceQuerying",+ # Avoid downloading remote navigation optimization hints during startup.+ "OptimizationHints",+ # Avoid lost iframe clicks and file chooser events while painting is deferred.+ # https://github.com/microsoft/playwright/issues/28023+ "PaintHolding",+ # Preserve browser context storage state when an origin is loaded in an iframe.+ # https://github.com/microsoft/playwright/issues/32230+ "ThirdPartyStoragePartitioning",+ # Prevent browser translation prompts from interrupting tests in other locales.+ "Translate",+ # Avoid creating the internal address bar popup page when tests replace pages.+ "WebUIOmniboxPopup",+ # Avoid creating the companion AI Mode popup page when tests replace pages.+ "WebUIOmniboxAimPopup",+ ]++ base_args = %W[--disable-search-engine-choice-screen+ --disable-features=#{disabled_features.join(",")}--no-sandbox--disable-dev-shm-usage--mute-audio