From 59203c63bb777a3bacec32fb8830fba33540e809 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:35:29 +0200 Subject: Adding upstream version 127.0. Signed-off-by: Daniel Baumann --- layout/tools/reftest/jar.mn | 1 - layout/tools/reftest/manifest.sys.mjs | 114 +---------------------------- layout/tools/reftest/reftest.sys.mjs | 2 + layout/tools/reftest/reftestcommandline.py | 5 -- layout/tools/reftest/runreftest.py | 30 +++++++- 5 files changed, 32 insertions(+), 120 deletions(-) (limited to 'layout/tools') diff --git a/layout/tools/reftest/jar.mn b/layout/tools/reftest/jar.mn index b879ac1646..4fc1b7e10f 100644 --- a/layout/tools/reftest/jar.mn +++ b/layout/tools/reftest/jar.mn @@ -25,7 +25,6 @@ reftest.jar: content/xul (../../reftests/xul/*) content/xul/reftest (../../xul/reftest/*) content/toolkit/reftests (../../../toolkit/content/tests/reftests/*) - content/osx-theme (../../../toolkit/themes/osx/reftests/*) content/reftest.xhtml (reftest.xhtml) # Crash tests diff --git a/layout/tools/reftest/manifest.sys.mjs b/layout/tools/reftest/manifest.sys.mjs index a4a8ed126f..09ccefd9f7 100644 --- a/layout/tools/reftest/manifest.sys.mjs +++ b/layout/tools/reftest/manifest.sys.mjs @@ -155,6 +155,7 @@ function ReadManifest(aURL, aFilter, aManifestID) { var origLength = items.length; items = defaults.concat(items); + var modifiers = [...items]; while ( items[0].match( /^(fails|needs-focus|random|skip|asserts|slow|require-or|silentfail|pref|test-pref|ref-pref|fuzzy|chaos-mode|wr-capture|wr-capture-ref|noautofuzz)/ @@ -492,6 +493,7 @@ function ReadManifest(aURL, aFilter, aManifestID) { chaosMode, wrCapture, noAutoFuzz, + modifiers, }, aFilter, aManifestID @@ -572,6 +574,7 @@ function ReadManifest(aURL, aFilter, aManifestID) { chaosMode, wrCapture, noAutoFuzz, + modifiers, }, aFilter, aManifestID @@ -612,22 +615,7 @@ function BuildConditionSandbox(aURL) { sandbox.isDebugBuild = g.debug.isDebugBuild; sandbox.isCoverageBuild = g.isCoverageBuild; - sandbox.xulRuntime = Cu.cloneInto( - { - widgetToolkit: Services.appinfo.widgetToolkit, - OS: Services.appinfo.OS, - XPCOMABI: Services.appinfo.XPCOMABI, - }, - sandbox - ); - - sandbox.smallScreen = false; - if ( - g.containingWindow.innerWidth < 800 || - g.containingWindow.innerHeight < 1000 - ) { - sandbox.smallScreen = true; - } + sandbox.xulRuntime = {}; var gfxInfo = NS_GFXINFO_CONTRACTID in Cc && @@ -639,32 +627,6 @@ function BuildConditionSandbox(aURL) { return obj[key]; }; - try { - sandbox.d2d = readGfxInfo(gfxInfo, "D2DEnabled"); - sandbox.dwrite = readGfxInfo(gfxInfo, "DWriteEnabled"); - sandbox.embeddedInFirefoxReality = readGfxInfo( - gfxInfo, - "EmbeddedInFirefoxReality" - ); - } catch (e) { - sandbox.d2d = false; - sandbox.dwrite = false; - sandbox.embeddedInFirefoxReality = false; - } - - var canvasBackend = readGfxInfo(gfxInfo, "AzureCanvasBackend"); - var contentBackend = readGfxInfo(gfxInfo, "AzureContentBackend"); - - sandbox.gpuProcess = gfxInfo.usingGPUProcess; - sandbox.azureCairo = canvasBackend == "cairo"; - sandbox.azureSkia = canvasBackend == "skia"; - sandbox.skiaContent = contentBackend == "skia"; - sandbox.azureSkiaGL = false; - // true if we are using the same Azure backend for rendering canvas and content - sandbox.contentSameGfxBackendAsCanvas = - contentBackend == canvasBackend || - (contentBackend == "none" && canvasBackend == "cairo"); - try { var windowProtocol = readGfxInfo(gfxInfo, "windowProtocol"); sandbox.wayland = windowProtocol == "wayland"; @@ -672,28 +634,18 @@ function BuildConditionSandbox(aURL) { sandbox.wayland = false; } - sandbox.remoteCanvas = - Services.prefs.getBoolPref("gfx.canvas.remote") && - sandbox.d2d && - sandbox.gpuProcess; - sandbox.mozinfo = Services.prefs.getStringPref("sandbox.mozinfo", null); sandbox.os_version = sandbox.mozinfo.os_version; - sandbox.layersGPUAccelerated = g.windowUtils.layerManagerType != "Basic"; sandbox.d3d11 = g.windowUtils.layerManagerType == "Direct3D 11"; - sandbox.d3d9 = g.windowUtils.layerManagerType == "Direct3D 9"; - sandbox.layersOpenGL = g.windowUtils.layerManagerType == "OpenGL"; sandbox.swgl = g.windowUtils.layerManagerType.startsWith( "WebRender (Software" ); - sandbox.layersOMTC = !!g.windowUtils.layerManagerRemote; // Shortcuts for widget toolkits. sandbox.Android = Services.appinfo.OS == "Android"; sandbox.cocoaWidget = Services.appinfo.widgetToolkit == "cocoa"; sandbox.gtkWidget = Services.appinfo.widgetToolkit == "gtk"; - sandbox.qtWidget = Services.appinfo.widgetToolkit == "qt"; sandbox.winWidget = Services.appinfo.widgetToolkit == "windows"; sandbox.is64Bit = Services.appinfo.is64Bit; @@ -701,27 +653,11 @@ function BuildConditionSandbox(aURL) { // Use this to annotate reftests that fail in drawSnapshot, but // the reason hasn't been investigated (or fixed) yet. sandbox.useDrawSnapshot = g.useDrawSnapshot; - // Use this to annotate reftests that use functionality - // that isn't available to drawSnapshot (like any sort of - // compositor feature such as async scrolling). - sandbox.unsupportedWithDrawSnapshot = g.useDrawSnapshot; - - sandbox.retainedDisplayList = - Services.prefs.getBoolPref("layout.display-list.retain") && - !sandbox.useDrawSnapshot; - - // Needed to specifically test the new and old behavior. This will eventually be removed. - sandbox.retainedDisplayListNew = - sandbox.retainedDisplayList && - Services.prefs.getBoolPref("layout.display-list.retain.sc"); // GeckoView is currently uniquely identified by "android + e10s" but // we might want to make this condition more precise in the future. sandbox.geckoview = sandbox.Android && g.browserIsRemote; - // Scrollbars that are semi-transparent. See bug 1169666. - sandbox.transparentScrollbars = Services.appinfo.widgetToolkit == "gtk"; - if (sandbox.Android) { sandbox.AndroidVersion = Services.sysinfo.getPropertyAsInt32("version"); @@ -734,35 +670,15 @@ function BuildConditionSandbox(aURL) { // Some reftests need extra fuzz on the Android 13 Pixel 5 devices. sandbox.Android13 = sandbox.AndroidVersion == "33"; - sandbox.MinGW = - sandbox.winWidget && Services.sysinfo.getPropertyAsBool("isMinGW"); - sandbox.AddressSanitizer = AppConstants.ASAN; sandbox.ThreadSanitizer = AppConstants.TSAN; sandbox.webrtc = AppConstants.MOZ_WEBRTC; - sandbox.jxl = AppConstants.MOZ_JXL; - - sandbox.compareRetainedDisplayLists = g.compareRetainedDisplayLists; sandbox.release_or_beta = AppConstants.RELEASE_OR_BETA; var hh = Cc[NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX + "http"].getService( Ci.nsIHttpProtocolHandler ); - var httpProps = [ - "userAgent", - "appName", - "appVersion", - "vendor", - "vendorSub", - "product", - "productSub", - "oscpu", - "language", - "misc", - ]; - sandbox.http = new sandbox.Object(); - httpProps.forEach(x => (sandbox.http[x] = hh[x])); // Set OSX to be the Mac OS X version, as an integer, or undefined // for other platforms. The integer is formed by 100 times the @@ -779,11 +695,6 @@ function BuildConditionSandbox(aURL) { false ); - sandbox.gpuProcessForceEnabled = Services.prefs.getBoolPref( - "layers.gpu-process.force-enabled", - false - ); - sandbox.prefs = Cu.cloneInto( { getBoolPref(p) { @@ -797,28 +708,11 @@ function BuildConditionSandbox(aURL) { { cloneFunctions: true } ); - // Tests shouldn't care about this except for when they need to - // crash the content process - sandbox.browserIsRemote = g.browserIsRemote; - sandbox.browserIsFission = g.browserIsFission; - - try { - sandbox.asyncPan = - g.containingWindow.docShell.asyncPanZoomEnabled && - !sandbox.useDrawSnapshot; - } catch (e) { - sandbox.asyncPan = false; - } - - // Graphics features - sandbox.usesRepeatResampling = sandbox.d2d; - // Running in a test-verify session? sandbox.verify = Services.prefs.getBoolPref("reftest.verify", false); // Running with a variant enabled? sandbox.fission = Services.appinfo.fissionAutostart; - sandbox.serviceWorkerE10s = true; if (!g.dumpedConditionSandbox) { g.logger.info( diff --git a/layout/tools/reftest/reftest.sys.mjs b/layout/tools/reftest/reftest.sys.mjs index 0f103c5816..12bdab98f9 100644 --- a/layout/tools/reftest/reftest.sys.mjs +++ b/layout/tools/reftest/reftest.sys.mjs @@ -1512,6 +1512,8 @@ function RecordResult(testRunTime, errorMsg, typeSpecificResults) { extra.image1 = image1; } } + extra.modifiers = g.urls[0].modifiers; + logger.testStatus( g.urls[0].identifier, message, diff --git a/layout/tools/reftest/reftestcommandline.py b/layout/tools/reftest/reftestcommandline.py index e2f0baff8c..13154b2456 100644 --- a/layout/tools/reftest/reftestcommandline.py +++ b/layout/tools/reftest/reftestcommandline.py @@ -478,11 +478,6 @@ class DesktopArgumentsParser(ReftestArgumentsParser): help="run tests in parallel if possible", ) - def _prefs_gpu(self): - if mozinfo.os != "win": - return ["layers.acceleration.force-enabled=true"] - return [] - def validate(self, options, reftest): super(DesktopArgumentsParser, self).validate(options, reftest) diff --git a/layout/tools/reftest/runreftest.py b/layout/tools/reftest/runreftest.py index e97a6de5d7..cac1f7dd3c 100644 --- a/layout/tools/reftest/runreftest.py +++ b/layout/tools/reftest/runreftest.py @@ -302,6 +302,7 @@ class RefTest(object): self.outputHandler = None self.testDumpFile = os.path.join(tempfile.gettempdir(), "reftests.json") self.currentManifest = "No test started" + self.gtkTheme = self.getGtkTheme() self.run_by_manifest = True if suite in ("crashtest", "jstestbrowser"): @@ -328,6 +329,17 @@ class RefTest(object): "reftest harness", options, {"tbpl": sys.stdout}, fmt_options ) + def getGtkTheme(self): + if not platform.system() == "Linux": + return "" + + theme_cmd = "gsettings get org.gnome.desktop.interface gtk-theme" + theme = subprocess.check_output(theme_cmd, shell=True, universal_newlines=True) + if theme: + theme = theme.strip("\n") + theme = theme.strip("'") + return theme.strip() + def getFullPath(self, path): "Get an absolute path relative to self.oldcwd." return os.path.normpath(os.path.join(self.oldcwd, os.path.expanduser(path))) @@ -357,14 +369,14 @@ class RefTest(object): locations.add_host(server, scheme="http", port=port) locations.add_host(server, scheme="https", port=port) - sandbox_whitelist_paths = options.sandboxReadWhitelist + sandbox_allowlist_paths = options.sandboxReadWhitelist if platform.system() == "Linux" or platform.system() in ( "Windows", "Microsoft", ): # Trailing slashes are needed to indicate directories on Linux and Windows - sandbox_whitelist_paths = map( - lambda p: os.path.join(p, ""), sandbox_whitelist_paths + sandbox_allowlist_paths = map( + lambda p: os.path.join(p, ""), sandbox_allowlist_paths ) addons = [] @@ -390,7 +402,7 @@ class RefTest(object): kwargs = { "addons": addons, "locations": locations, - "whitelistpaths": sandbox_whitelist_paths, + "allowlistpaths": sandbox_allowlist_paths, } if profile_to_clone: profile = mozprofile.Profile.clone(profile_to_clone, **kwargs) @@ -539,6 +551,9 @@ class RefTest(object): browserEnv["TZ"] = "PST8PDT" browserEnv["LC_ALL"] = "en_US.UTF-8" + # This should help with consistency + browserEnv["GTK_THEME"] = "Adwaita" + for v in options.environment: ix = v.find("=") if ix <= 0: @@ -1100,6 +1115,13 @@ class RefTest(object): overall = 0 status = -1 for manifest, tests in tests_by_manifest.items(): + if self.getGtkTheme() != self.gtkTheme: + self.log.error( + "Theme (%s) has changed to (%s), terminating job as this is unstable" + % (self.gtkTheme, self.getGtkTheme()) + ) + return 1 + self.log.info("Running tests in {}".format(manifest)) self.currentManifest = manifest status = run(tests=tests) -- cgit v1.2.3