Bug 1891887 - Remove reftest sandbox conditions that are not used. r=tnikkel

Differential Revision: https://phabricator.services.mozilla.com/D207650
This commit is contained in:
Joel Maher 2024-04-17 19:17:19 +00:00
parent e177223cf6
commit 663b9403e5
35 changed files with 48 additions and 157 deletions

View File

@ -31,22 +31,25 @@ class XULInfo:
self.abi = abi
self.os = os
self.isdebug = isdebug
self.browserIsRemote = False
def as_js(self):
"""Return JS that when executed sets up variables so that JS expression
predicates on XUL build info evaluate properly."""
return (
'var xulRuntime = {{ OS: "{}", XPCOMABI: "{}", shell: true }};'
"var winWidget = {};"
"var gtkWidget = {};"
"var cocoaWidget = {};"
"var is64Bit = {};"
"var xulRuntime = {{ shell: true }};"
"var release_or_beta = getBuildConfiguration('release_or_beta');"
"var isDebugBuild={}; var Android={}; "
"var browserIsRemote={}".format(
self.os,
self.abi,
"var isDebugBuild={}; var Android={}; ".format(
str(self.os == "WINNT").lower(),
str(self.os == "Darwin").lower(),
str(self.os == "Linux").lower(),
str("x86-" not in self.abi).lower(),
str(self.isdebug).lower(),
str(self.os == "Android").lower(),
str(self.browserIsRemote).lower(),
)
)
@ -258,7 +261,7 @@ def _parse_one(testcase, terms, xul_tester):
pos += 1
elif parts[pos] == "silentfail":
# silentfails use tons of memory, and Darwin doesn't support ulimit.
if xul_tester.test("xulRuntime.OS == 'Darwin'", testcase.options):
if xul_tester.test("cocoaWidget", testcase.options):
testcase.expect = testcase.enable = False
pos += 1
elif parts[pos].startswith("error:"):

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.XPCOMABI.match(/x86_64|aarch64|ppc64|ppc64le|s390x|mips64|loongarch64|riscv64/)||Android) -- No test results
// |reftest| skip-if(is64Bit||Android) -- No test results
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| slow-if(xulRuntime.XPCOMABI.match(/x86_64|aarch64|ppc64|ppc64le|s390x|mips64|loongarch64|riscv64/)||Android) -- No test results
// |reftest| slow-if(is64Bit||Android) -- No test results
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| random-if(xulRuntime.OS=="Linux")
// |reftest| random-if(gtkWidget)
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.OS=="WINNT") -- Windows doesn't accept IANA names for the TZ env variable
// |reftest| skip-if(winWidget) -- Windows doesn't accept IANA names for the TZ env variable
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.OS=="WINNT") -- Windows doesn't accept IANA names for the TZ env variable
// |reftest| skip-if(winWidget) -- Windows doesn't accept IANA names for the TZ env variable
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.OS=="WINNT") -- Windows doesn't accept IANA names for the TZ env variable
// |reftest| skip-if(winWidget) -- Windows doesn't accept IANA names for the TZ env variable
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.OS=="WINNT") -- Windows doesn't accept IANA names for the TZ env variable
// |reftest| skip-if(winWidget) -- Windows doesn't accept IANA names for the TZ env variable
// bug 1676708
inTimeZone("Europe/London", () => {

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.OS=="WINNT") -- Windows doesn't accept IANA names for the TZ env variable
// |reftest| skip-if(winWidget) -- Windows doesn't accept IANA names for the TZ env variable
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.OS=="WINNT") -- Windows doesn't accept IANA names for the TZ env variable
// |reftest| skip-if(winWidget) -- Windows doesn't accept IANA names for the TZ env variable
const testCases = [
{

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.OS=="WINNT"||!xulRuntime.shell)
// |reftest| skip-if(winWidget||!xulRuntime.shell)
assertEq(/^(PST|PDT)$/.test(getTimeZone()), true,
"The default time zone is set to PST8PDT for all jstests (when run in the shell)");

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.OS=="WINNT"||!xulRuntime.shell||!this.hasOwnProperty("Intl"))
// |reftest| skip-if(winWidget||!xulRuntime.shell||!this.hasOwnProperty("Intl"))
assertEq(/^(PST|PDT)$/.test(getTimeZone()), true,
"The default time zone is set to PST8PDT for all jstests (when run in the shell)");

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.OS=="WINNT"||!this.hasOwnProperty("Intl")) -- Windows doesn't accept IANA names for the TZ env variable; Requires ICU time zone support
// |reftest| skip-if(winWidget||!this.hasOwnProperty("Intl")) -- Windows doesn't accept IANA names for the TZ env variable; Requires ICU time zone support
// bug 487897
inTimeZone("Europe/London", () => {

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.OS=="WINNT"||!this.hasOwnProperty("Intl")) -- Windows doesn't accept IANA names for the TZ env variable; Requires ICU time zone support
// |reftest| skip-if(winWidget||!this.hasOwnProperty("Intl")) -- Windows doesn't accept IANA names for the TZ env variable; Requires ICU time zone support
// Imported tests from es6draft and then adapted to use ICU/CLDR time zone display names.

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.OS=="WINNT"||xulRuntime.OS=="Darwin") -- Skip on OS X in addition to Windows
// |reftest| skip-if(winWidget||cocoaWidget) -- Skip on OS X in addition to Windows
// Contains the tests from "time-zones.js" which fail on OS X.

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.OS=="WINNT"&&!xulRuntime.shell) -- Windows browser in automation doesn't pick up new time zones correctly
// |reftest| skip-if(winWidget&&!xulRuntime.shell) -- Windows browser in automation doesn't pick up new time zones correctly
// Repeats the test from "time-zones.js", but uses POSIX instead of IANA names
// for the time zones. This allows to run these tests on Windows, too.

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.OS=="WINNT") -- Windows doesn't accept IANA names for the TZ env variable
// |reftest| skip-if(winWidget) -- Windows doesn't accept IANA names for the TZ env variable
// bug 158328
inTimeZone("Europe/London", () => {

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.OS=="WINNT"||!this.hasOwnProperty("Intl")) -- Windows doesn't accept IANA names for the TZ env variable; Requires ICU time zone support
// |reftest| skip-if(winWidget||!this.hasOwnProperty("Intl")) -- Windows doesn't accept IANA names for the TZ env variable; Requires ICU time zone support
// Date.prototype.toString includes a localized time zone name comment.

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(!this.hasOwnProperty("Intl")||(xulRuntime.OS=="WINNT"&&!xulRuntime.shell)) -- Windows browser in automation doesn't pick up new time zones correctly
// |reftest| skip-if(!this.hasOwnProperty("Intl")||(winWidget&&!xulRuntime.shell)) -- Windows browser in automation doesn't pick up new time zones correctly
// From bug 1330149:
//

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(!xulRuntime.shell&&(Android||xulRuntime.OS=="WINNT")) silentfail
// |reftest| skip-if(!xulRuntime.shell&&(Android||winWidget)) silentfail
/*
* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/licenses/publicdomain/

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(!Object.prototype.toSource||(!xulRuntime.shell&&((Android||(isDebugBuild&&xulRuntime.OS=="Linux")||xulRuntime.XPCOMABI.match(/x86_64/))))) slow -- can fail silently due to out of memory, bug 615011 - timeouts on slow debug Linux
// |reftest| skip-if(!Object.prototype.toSource||(!xulRuntime.shell&&((Android||(isDebugBuild&&gtkWidget)||is64Bit)))) slow -- can fail silently due to out of memory, bug 615011 - timeouts on slow debug Linux
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(!Object.prototype.toSource||(!xulRuntime.shell&&((isDebugBuild&&xulRuntime.OS=="Linux")||Android||xulRuntime.XPCOMABI.match(/x86_64/)||xulRuntime.OS=="WINNT"))) slow -- can fail silently due to out of memory, bug 621348 - timeouts on slow debug Linux
// |reftest| skip-if(!Object.prototype.toSource||(!xulRuntime.shell&&((isDebugBuild&&gtkWidget)||Android||is64Bit||winWidget))) slow -- can fail silently due to out of memory, bug 621348 - timeouts on slow debug Linux
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(!Object.prototype.toSource||(!xulRuntime.shell&&(Android||xulRuntime.OS=="WINNT"||xulRuntime.OS=="Linux"))) silentfail slow -- bug 528464
// |reftest| skip-if(!Object.prototype.toSource||(!xulRuntime.shell&&(Android||winWidget||gtkWidget))) silentfail slow -- bug 528464
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.shell||(xulRuntime.OS=="WINNT"&&isDebugBuild)) slow
// |reftest| skip-if(xulRuntime.shell||(winWidget&&isDebugBuild)) slow
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.shell||(xulRuntime.OS=="WINNT"&&isDebugBuild)) slow
// |reftest| skip-if(xulRuntime.shell||(winWidget&&isDebugBuild)) slow
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.shell||(xulRuntime.OS=="WINNT"&&isDebugBuild)) slow
// |reftest| skip-if(xulRuntime.shell||(winWidget&&isDebugBuild)) slow
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.OS=="Linux"&&!xulRuntime.shell&&!xulRuntime.XPCOMABI.match(/x86_64/)&&isDebugBuild) -- bug 521549
// |reftest| skip-if(gtkWidget&&!xulRuntime.shell&&!is64Bit&&isDebugBuild) -- bug 521549
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.shell||(xulRuntime.OS=="WINNT"&&isDebugBuild)) slow
// |reftest| skip-if(xulRuntime.shell||(winWidget&&isDebugBuild)) slow
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.XPCOMABI.match(/x86_64|aarch64|ppc64|ppc64le|s390x|mips64|loongarch64|riscv64/)) -- On 64-bit, takes forever rather than throwing
// |reftest| skip-if(is64Bit) -- On 64-bit, takes forever rather than throwing
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(xulRuntime.shell||(xulRuntime.OS=="WINNT"&&isDebugBuild)) slow
// |reftest| skip-if(xulRuntime.shell||(winWidget&&isDebugBuild)) slow
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this

View File

@ -1,4 +1,4 @@
// |reftest| skip-if(!xulRuntime.shell||xulRuntime.OS=="WINNT")
// |reftest| skip-if(!xulRuntime.shell||winWidget)
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Any copyright is dedicated to the Public Domain.

View File

@ -12,7 +12,7 @@ skip-if(useDrawSnapshot) fuzzy-if(gtkWidget,0-1,0-87) fuzzy-if(!gtkWidget,0-1,0-
skip-if(useDrawSnapshot) == bg-fixed-child-no-culling-1.html bg-fixed-child-no-culling-1-ref.html
skip-if(useDrawSnapshot) == bg-fixed-child-no-culling-2.html bg-fixed-child-no-culling-2-ref.html
skip-if(useDrawSnapshot) == bg-fixed-child-no-culling-3.html bg-fixed-child-no-culling-3-ref.html
fuzzy-if(Android,0-2,0-4000) fuzzy-if(cocoaWidget,0-2,0-179524) fuzzy-if(winWidget,0-1,0-74590) fuzzy-if(gtkWidget&&layersGPUAccelerated,0-1,0-3528) skip-if(useDrawSnapshot) fuzzy-if(geckoview,0-1,0-74590) == bg-fixed-transformed-image.html bg-fixed-transformed-image-ref.html
fuzzy-if(Android,0-2,0-4000) fuzzy-if(cocoaWidget,0-2,0-179524) fuzzy-if(winWidget,0-1,0-74590) fuzzy-if(gtkWidget,0-1,0-3528) skip-if(useDrawSnapshot) fuzzy-if(geckoview,0-1,0-74590) == bg-fixed-transformed-image.html bg-fixed-transformed-image-ref.html
skip-if(useDrawSnapshot) == contain-paint-scrollable-frame-1.html contain-paint-scrollable-frame-1-ref.html
skip-if(useDrawSnapshot) == element-1.html element-1-ref.html
pref(layers.force-active,true) skip-if(useDrawSnapshot) == iframe-1.html iframe-1-ref.html
@ -73,7 +73,7 @@ fuzzy-if(Android,0-6,0-4) skip == position-sticky-scrolled-clip-2.html position-
fuzzy-if(Android,0-8,0-27) fuzzy-if(cocoaWidget,9-11,20-44) skip-if(useDrawSnapshot) == curtain-effect-1.html curtain-effect-1-ref.html
fuzzy-if(Android,0-7,0-9) fuzzy-if(gtkWidget,10-15,12-32) fuzzy-if(cocoaWidget,5-9,20-42) skip-if(useDrawSnapshot) == transformed-1.html transformed-1-ref.html # Bug 1604338
fuzzy-if(Android,2-7,1-12) fuzzy-if(gtkWidget,3-5,12-28) fuzzy-if(cocoaWidget,5-6,18-38) skip-if(useDrawSnapshot) fuzzy-if(swgl&&cocoaWidget&&isDebugBuild,0-6,0-38) == position-sticky-transformed-in-scrollframe-1.html position-sticky-transformed-in-scrollframe-1-ref.html # Bug 1604338
fuzzy-if(Android,3-3,1-470) fuzzy-if(Android&&swgl&&isDebugBuild&&/^aarch64-gcc3/.test(xulRuntime.XPCOMABI),3-3,457-457) fuzzy-if(gtkWidget,13-20,12-32) fuzzy-if(cocoaWidget,12-16,20-44) skip-if(useDrawSnapshot) == position-sticky-transformed-in-scrollframe-2.html position-sticky-transformed-in-scrollframe-2-ref.html # Bug 1604338
fuzzy-if(Android,3-3,1-470) fuzzy-if(gtkWidget,13-20,12-32) fuzzy-if(cocoaWidget,12-16,20-44) skip-if(useDrawSnapshot) == position-sticky-transformed-in-scrollframe-2.html position-sticky-transformed-in-scrollframe-2-ref.html # Bug 1604338
fuzzy-if(Android,12-13,4-31) fuzzy-if(gtkWidget,16-27,14-32) fuzzy-if(cocoaWidget,13-16,20-44) skip-if(useDrawSnapshot) == position-sticky-in-transformed-scrollframe-1.html position-sticky-in-transformed-scrollframe-ref.html # Bug 1604338
fuzzy-if(Android,12-13,4-31) fuzzy-if(gtkWidget,16-27,14-32) fuzzy-if(cocoaWidget,13-16,20-44) skip-if(useDrawSnapshot) == position-sticky-in-transformed-scrollframe-2.html position-sticky-in-transformed-scrollframe-ref.html # Bug 1604338

View File

@ -46,11 +46,6 @@ fails-if(geckoview&&device) == filter-2.xhtml filter-2-ref.xhtml
== invalidation.html about:blank
fails-if(useDrawSnapshot) == zoom-invalidation.html zoom-invalidation-ref.html # bug 773482
# test that xulRuntime.OS works
fails-if(xulRuntime.OS!="Linux"&&!Android) == data:text/html,<body>Linux data:text/html,<script>document.write(navigator.platform.substr(0,5))</script>
fails-if(xulRuntime.OS!="WINNT") == data:text/html,<body>Win data:text/html,<script>document.write(navigator.platform.substr(0,3))</script>
fails-if(xulRuntime.OS!="Darwin") == data:text/html,<body>Mac data:text/html,<script>document.write(navigator.platform.substr(0,3))</script>
# test parsing of asserts() expressions
asserts(0) load about:blank
asserts(0-5) load about:blank

View File

@ -18,7 +18,8 @@ include position-relative/reftest.list
# apng-mime
include apng-mime/reftest.list
skip-if(unsupportedWithDrawSnapshot) include async-scrolling/reftest.list
# unsupported with draw snapshot
skip-if(useDrawSnapshot) include async-scrolling/reftest.list
# backgrounds/
include backgrounds/reftest.list
@ -431,7 +432,8 @@ include invalidation/reftest.list
include ../../dom/encoding/test/reftest/reftest.list
# APZ/async positioning tests
skip-if(unsupportedWithDrawSnapshot) include ../../gfx/layers/apz/test/reftest/reftest.list
# unsupported with draw snapshot
skip-if(useDrawSnapshot) include ../../gfx/layers/apz/test/reftest/reftest.list
# Display list building
include display-list/reftest.list

View File

@ -612,22 +612,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 +624,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 +631,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 +650,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 +667,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 +692,6 @@ function BuildConditionSandbox(aURL) {
false
);
sandbox.gpuProcessForceEnabled = Services.prefs.getBoolPref(
"layers.gpu-process.force-enabled",
false
);
sandbox.prefs = Cu.cloneInto(
{
getBoolPref(p) {
@ -797,28 +705,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(