Bug 1616368 - [reftest] Replace 'default-preferences' with 'defaults' r=dbaron

With the new 'defaults' key being added, 'default-preferences' is now
redundant. This commit converts all existing uses of 'default-preferences' to
use 'defaults' instead.

Differential Revision: https://phabricator.services.mozilla.com/D63247

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrew Halberstadt 2020-02-20 18:47:54 +00:00
Родитель e08b5215e1
Коммит 4d752c4ca7
30 изменённых файлов: 49 добавлений и 135 удалений

Просмотреть файл

@ -1,4 +1,4 @@
default-preferences pref(canvas.filters.enabled,true)
defaults pref(canvas.filters.enabled,true)
== default-color.html ref.html
== drop-shadow.html ref.html

Просмотреть файл

@ -1,5 +1,8 @@
# Canvas Filter Reftests
include filters/reftest.list
# WebGL Reftests!
default-preferences pref(webgl.force-enabled,true) pref(media.useAudioChannelAPI,true)
defaults pref(webgl.force-enabled,true) pref(media.useAudioChannelAPI,true)
# Check that disabling works:
== webgl-disable-test.html?nogl wrapper.html?green.png
@ -163,9 +166,6 @@ pref(canvas.focusring.enabled,true) skip-if(cocoaWidget) skip-if(winWidget) fuzz
fuzzy-if(azureSkia,0-16,0-2) fuzzy-if(Android,0-3,0-40) fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-1) == 1177726-text-stroke-bounds.html 1177726-text-stroke-bounds-ref.html
# Canvas Filter Reftests
include filters/reftest.list
# Bug 1305963
== mozCurrentTransform.html mozCurrentTransform-ref.html
== mozCurrentTransformInverse.html mozCurrentTransform-ref.html

Просмотреть файл

@ -1,4 +1,4 @@
default-preferences pref(dom.forms.datetime,true)
defaults pref(dom.forms.datetime,true)
needs-focus == input-load.html input-ref.html
needs-focus == input-create.html input-ref.html
needs-focus == input-number.html input-number-ref.html

Просмотреть файл

@ -1,4 +1,4 @@
default-preferences pref(media.peerconnection.enabled,true) pref(media.navigator.permission.disabled,true) pref(dom.disable_open_during_load,false) pref(media.devices.insecure.enabled,true) pref(media.getusermedia.insecure.enabled,true)
defaults pref(media.peerconnection.enabled,true) pref(media.navigator.permission.disabled,true) pref(dom.disable_open_during_load,false) pref(media.devices.insecure.enabled,true) pref(media.getusermedia.insecure.enabled,true)
load 780790.html
load 791270.html

Просмотреть файл

@ -1,6 +1,6 @@
# WebVR Reftests
# Please confirm there is no other VR display connected. Otherwise, VRPuppetDisplay can't be attached.
default-preferences pref(dom.vr.puppet.enabled,true) pref(dom.vr.test.enabled,true) pref(dom.vr.require-gesture,false) pref(dom.vr.puppet.submitframe,1) pref(dom.vr.display.rafMaxDuration,200) pref(dom.vr.display.enumerate.interval,0) pref(dom.vr.controller.enumerate.interval,0)
defaults pref(dom.vr.puppet.enabled,true) pref(dom.vr.test.enabled,true) pref(dom.vr.require-gesture,false) pref(dom.vr.puppet.submitframe,1) pref(dom.vr.display.rafMaxDuration,200) pref(dom.vr.display.enumerate.interval,0) pref(dom.vr.controller.enumerate.interval,0)
# WebVR Tests have been disabled as refactoring of gfxVRPuppet is landing. Dependencies for re-enabling these are tracked by meta bug 1555185.
# VR SubmitFrame is only implemented for D3D11.1 and MacOSX now.
# Our Windows 7 test machines don't support D3D11.1, so we run these tests on Windows 8+ only.

Просмотреть файл

@ -14,7 +14,7 @@
#
# IMPORTANT: For robustness, each test should be listed *twice* in this
# manifest -- once with the high quality downscaling pref disabled, and once
# with this pref enabled. The pref is set via "default-preferences", so
# with this pref enabled. The pref is set via "defaults", so
# simply appending a new test to the lists below each of those lines should be
# sufficient.
#
@ -35,7 +35,7 @@ fuzzy(0-51,0-90) fuzzy-if(skiaContent,0-142,0-77) fuzzy-if(webrender,64-64,31-31
# RUN TESTS WITH DOWNSCALE-DURING-DECODE DISABLED:
# ================================================
default-preferences pref(image.downscale-during-decode.enabled,false)
defaults pref(image.downscale-during-decode.enabled,false)
fuzzy-if(winWidget,0-16,0-20) fuzzy-if(cocoaWidget,0-106,0-31) == downscale-1.html downscale-1-ref.html
@ -112,7 +112,7 @@ fuzzy(0-1,0-1024) == downscale-32px.html?.jpg downscale-32px-ref.html
# RUN TESTS WITH DOWNSCALE-DURING-DECODE ENABLED:
# ===============================================
default-preferences pref(image.downscale-during-decode.enabled,true)
defaults pref(image.downscale-during-decode.enabled,true)
fuzzy(0-31,0-127) fuzzy-if(d2d,0-31,0-147) == downscale-1.html downscale-1-ref.html # intermittently 147 pixels on win7 accelerated only (not win8)

Просмотреть файл

@ -81,11 +81,11 @@ fuzzy-if(Android&&!webrender,3-3,4-4) fuzzy-if(Android&&webrender,13-13,4-4) fuz
# as it will expand the displayport beyond what the test specifies in
# its reftest-displayport attributes, and interfere with where we expect
# checkerboarding to occur
default-preferences pref(layers.low-precision-buffer,false)
defaults pref(layers.low-precision-buffer,false)
skip-if(!asyncPan) == checkerboard-1.html checkerboard-1-ref.html
skip-if(!asyncPan) == checkerboard-2.html checkerboard-2-ref.html
skip-if(!asyncPan) == checkerboard-3.html checkerboard-3-ref.html
default-preferences
defaults
skip-if(!Android) pref(apz.allow_zooming,true) == position-fixed-async-zoom-1.html position-fixed-async-zoom-1-ref.html
skip-if(!Android) pref(apz.allow_zooming,true) == position-fixed-async-zoom-2.html position-fixed-async-zoom-2-ref.html

Просмотреть файл

@ -1,4 +1,4 @@
default-preferences pref(layout.css.scrollbar-color.enabled,true)
defaults pref(layout.css.scrollbar-color.enabled,true)
== viewport-scrollbar-color-change.html viewport-scrollbar-color-change-ref.html
== scrollbar-thin-overflow-change.html scrollbar-thin-overflow-change-ref.html

Просмотреть файл

@ -195,12 +195,12 @@ random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) != meiryo-en-bolditalic.htm
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) != meiryo-en-bolditalic.html meiryo-en-bold.html # Bug 1392106
# test support of variation-font format hints
default-preferences pref(layout.css.font-variations.enabled,false)
defaults pref(layout.css.font-variations.enabled,false)
== variation-format-hint-1a.html variation-format-hint-1A-ref.html
== variation-format-hint-1b.html variation-format-hint-1A-ref.html
== variation-format-hint-1c.html variation-format-hint-1A-ref.html
== variation-format-hint-1d.html variation-format-hint-1A-ref.html
default-preferences pref(layout.css.font-variations.enabled,true)
defaults pref(layout.css.font-variations.enabled,true)
# Currently Windows 7 and macOS all fail on
# treeherder because our OS versions are too old to support variation fonts
fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)||(cocoaWidget&&OSX<1012)) == variation-format-hint-1a.html variation-format-hint-1B-ttf-ref.html
@ -208,4 +208,4 @@ fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)||(cocoaWidget&&OSX<1012)) ==
fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)||(cocoaWidget&&OSX<1012)) == variation-format-hint-1c.html variation-format-hint-1B-woff-ref.html
fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)||(cocoaWidget&&OSX<1012)) == variation-format-hint-1d.html variation-format-hint-1B-woff2-ref.html
default-preferences
defaults

Просмотреть файл

@ -9,7 +9,7 @@
# The font-inflation code uses the meta-viewport tag as one of its inputs
# when determining if font-inflation needs to be applied, so enable it for
# these tests.
default-preferences pref(dom.meta-viewport.enabled,true)
defaults pref(dom.meta-viewport.enabled,true)
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) test-pref(font.size.inflation.maxRatio,200) == maxRatio-1.html maxRatio-1-ref.html
test-pref(font.size.inflation.emPerLine,15) test-pref(font.size.inflation.forceEnabled,true) test-pref(font.size.inflation.lineThreshold,0) == text-1.html text-1-ref.html
@ -123,4 +123,4 @@ pref(font.size.inflation.emPerLine,15) pref(font.size.inflation.forceEnabled,tru
random-if(gtkWidget) pref(font.size.inflation.emPerLine,15) pref(font.size.inflation.forceEnabled,true) == xul-reflow-1.html xul-reflow-1-ref.html
# reset the default preferences
default-preferences
defaults

Просмотреть файл

@ -1,4 +1,4 @@
default-preferences pref(layout.css.font-loading-api.enabled,true)
defaults pref(layout.css.font-loading-api.enabled,true)
== dynamic-insert-1.html dynamic-insert-1-ref.html
== dynamic-remove-1.html dynamic-remove-1-ref.html

Просмотреть файл

@ -2,7 +2,7 @@
# family names when looking up a requested font-family. Otherwise, tests here
# may fail if they're running too soon after browser startup, and localized
# names have not yet been read. (See bug 1439937.)
default-preferences pref(gfx.font_loader.delay,0)
defaults pref(gfx.font_loader.delay,0)
== CSS21-t1502-no-inherited-font-family.xhtml CSS21-t1502-no-inherited-font-family-ref.xhtml
@ -161,4 +161,4 @@ skip-if(!winWidget) == legacy-family-names-2.html legacy-family-names-2-ref.html
random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == descriptor-ranges.html descriptor-ranges-ref.html # Bug 1392106
# Reset default prefs.
default-preferences
defaults

Просмотреть файл

@ -1,5 +1,5 @@
# enable variation font support
default-preferences pref(layout.css.font-variations.enabled,true)
defaults pref(layout.css.font-variations.enabled,true)
== font-optical-sizing-1.html font-optical-sizing-1-ref.html
@ -8,4 +8,4 @@ default-preferences pref(layout.css.font-variations.enabled,true)
fails-if(OSX<1012) fails-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) != font-optical-sizing-1.html font-optical-sizing-1-notref.html
# reset the default preferences
default-preferences
defaults

Просмотреть файл

@ -1,6 +1,6 @@
== input-color-1.html input-color-1-ref.html
default-preferences pref(dom.forms.color,true)
defaults pref(dom.forms.color,true)
== margin-padding-1.html margin-padding-1-ref.html
== block-invalidate-1.html block-invalidate-1-ref.html

Просмотреть файл

@ -1,4 +1,4 @@
default-preferences pref(dom.forms.datetime,true)
defaults pref(dom.forms.datetime,true)
!= time-simple-unthemed.html time-simple-unthemed-ref.html
!= time-large-font.html time-basic.html

Просмотреть файл

@ -1,5 +1,5 @@
# This pref enables high-contrast mode in the testcases here:
default-preferences test-pref(browser.display.document_color_use,2) test-pref(browser.display.permit_backplate,true)
defaults test-pref(browser.display.document_color_use,2) test-pref(browser.display.permit_backplate,true)
# There are several platform-specific fuzzy-if notations below due to
# anti-aliasing, extra visual overflow, and slightly inacurate reftest

Просмотреть файл

@ -1,4 +1,4 @@
default-preferences pref(dom.meta-viewport.enabled,true) pref(apz.allow_zooming,true)
defaults pref(dom.meta-viewport.enabled,true) pref(apz.allow_zooming,true)
# These tests assume that viewport width in reftest is 800px.
== box-shadow.html initial-scale-0_5-ref.html

Просмотреть файл

@ -1,6 +0,0 @@
# test default-preferences on include commands
# In default-preferences-tests.list, the default-preferences line in effect
# before the include statement sets different font sizes for the test and
# reference files. Those default preferences should not inherit into this file.
== font-default.html font-default.html

Просмотреть файл

@ -1,28 +0,0 @@
# test default-preferences
# test default-preferences with a pref()
default-preferences pref(font.size.variable.x-western,24)
!= font-default.html font-size-16.html
== font-default.html font-size-24.html
# test that a default preference can be overridden
pref(font.size.variable.x-western,16) == font-default.html font-size-16.html
pref(font.size.variable.x-western,16) != font-default.html font-size-24.html
# test that default preferences are kept when other test-specific preferences are set
pref(font.size.variable.zh-HK,36) != font-default.html font-size-16.html
pref(font.size.variable.zh-HK,36) == font-default.html font-size-24.html
# test default-preferences with test-pref() and ref-pref()
default-preferences test-pref(font.size.variable.x-western,16) ref-pref(font.size.variable.x-western,24)
!= font-default.html font-default.html
== font-default.html font-size-16.html
== font-size-24.html font-default.html
# test that default-preferences does not apply to include commands
include default-preferences-include.list
# test resetting default-preferences
default-preferences
== font-default.html font-default.html

Просмотреть файл

@ -71,9 +71,6 @@ include urlprefixtests.list
# test defaults
include defaults-tests.list
# test default-preferences
include default-preferences-tests.list
# test that all corners are visible
!= corners-1.html corners-1-ref.html
!= corners-2.html corners-2-ref.html
@ -178,9 +175,9 @@ skip-if(!asyncPan||!browserIsRemote) == async-scroll-1a.html async-scroll-1-ref.
# Disable low-res painting for this test as it will cause more to
# be drawn than we want.
default-preferences pref(layers.low-precision-buffer,false)
defaults pref(layers.low-precision-buffer,false)
skip-if(!asyncPan||!browserIsRemote) != async-scroll-1b.html async-scroll-1-ref.html
default-preferences
defaults
skip-if(!Android) pref(apz.allow_zooming,true) != async-zoom-1.html async-zoom-1-ref.html
fuzzy(0-112,0-800) skip-if(!Android) pref(apz.allow_zooming,true) == async-zoom-2.html async-zoom-2-ref.html

Просмотреть файл

@ -47,13 +47,13 @@ gPrefixedProperties = [
gPrefixRegexp = (re.compile(r"([^-#]|^)(" + r"|".join(gPrefixedProperties) + r")\b")
if gPrefixedProperties else None)
# Map of about:config prefs that need toggling, for a given test subdirectory.
# Map of settings that need toggling for a given test subdirectory.
# Entries should look like:
# "$SUBDIR_NAME": "pref($PREF_NAME, $PREF_VALUE)"
#
# For example, when "@supports" was behind a pref, gDefaultPreferences had:
# For example, when "@supports" was behind a pref, gDefaults had:
# "css3-conditional": "pref(layout.css.supports-rule.enabled,true)"
gDefaultPreferences = {
gDefaults = {
}
gLog = None
@ -328,6 +328,7 @@ def read_fail_list():
pat = re.compile(fnmatch.translate(items.pop()))
gFailList.append((pat, refpat, items, comment))
def main():
global gDestPath, gLog, gTestfiles, gTestFlags, gFailList
read_options()
@ -347,22 +348,20 @@ def main():
# DO NOT EDIT!!!
# To update the test expectations, please edit failures.list, and rerun
# {0} locally on web platform tests repository against the
# revision listed at the beginning of received/import.log.\n\n"""\
# revision listed at the beginning of received/import.log.\n\n"""
.format(os.path.basename(__file__)))
lastDefaultPreferences = None
lastDefaults = None
for test in tests:
defaultPreferences = gDefaultPreferences.get(test[1].split("/")[0], None)
if defaultPreferences != lastDefaultPreferences:
if defaultPreferences is None:
listfile.write("\ndefault-preferences\n\n")
defaults = gDefaults.get(test[1].split("/")[0], None)
if defaults != lastDefaults:
if defaults is None:
listfile.write("\ndefaults\n\n")
else:
listfile.write("\ndefault-preferences {0}\n\n".format(defaultPreferences))
lastDefaultPreferences = defaultPreferences
listfile.write("\ndefaults {0}\n\n".format(defaults))
lastDefaults = defaults
key = 1
while not test[key] in gTestFlags.keys() and key < len(test):
key = key + 1
testType = test[key - 1]
testFlags = gTestFlags[test[key]]
# Replace the Windows separators if any. Our internal strings
# all use the system separator, however the failure/skip lists
# and reftest.list always use '/' so we fix the paths here.
@ -386,5 +385,6 @@ def main():
gLog.close()
if __name__ == '__main__':
main()

Просмотреть файл

@ -3,7 +3,7 @@
cd "$(dirname "$0")"
find . -name reftest.list | sed 's,/reftest.list$,,' | while read DIRNAME
do
cat "$DIRNAME/reftest.list" | grep -v -e "^defaults" -e "^default-preferences" -e "include " | sed 's/ #.*//;s/^#.*//;s/.* == /== /;s/.* != /!= /' | grep -v "^ *$" | while read TYPE TEST REF
cat "$DIRNAME/reftest.list" | grep -v -e "^defaults" -e "include " | sed 's/ #.*//;s/^#.*//;s/.* == /== /;s/.* != /!= /' | grep -v "^ *$" | while read TYPE TEST REF
do
REFTYPE=""
if [ "$TYPE" == "==" ]

Просмотреть файл

@ -1,4 +1,4 @@
default-preferences pref(layout.css.contain.enabled,true)
defaults pref(layout.css.contain.enabled,true)
== contain-paint-clip-001.html contain-paint-clip-001-ref.html
== contain-paint-clip-002.html contain-paint-clip-002-ref.html

Просмотреть файл

@ -33,7 +33,7 @@ for ((i = 0; i < $numImageFiles; i++)); do
hg add $videoDest
done
# Add comment & default-preferences line to reftest.list in dest directory:
# Add comment to reftest.list in dest directory:
reftestListFileName="$VIDEO_REFTEST_PATH/reftest.list"
echo "
# Tests for <video src> with 'object-fit' & 'object-position':

Просмотреть файл

@ -41,7 +41,7 @@ fuzzy(0-5,0-111556) == webm-alpha-2.html webm-alpha-2-ref.html
# reftest directory. They live here because they use WebM video (VP9), and it
# wouldn't be fair of us to make a W3C testsuite implicitly depend on any
# particular (non-spec-mandated) video codec.
default-preferences test-pref(gfx.ycbcr.accurate-conversion,true)
defaults test-pref(gfx.ycbcr.accurate-conversion,true)
fails-if(layersGPUAccelerated) == object-fit-contain-webm-001.html object-fit-contain-webm-001-ref.html # Bug 1083516 for layersGPUAccelerated failures
fails-if(layersGPUAccelerated) == object-fit-contain-webm-002.html object-fit-contain-webm-002-ref.html # Bug 1083516 for layersGPUAccelerated failures
fails-if(layersGPUAccelerated) == object-fit-cover-webm-001.html object-fit-cover-webm-001-ref.html # Bug 1083516 for layersGPUAccelerated failures

Просмотреть файл

@ -26,7 +26,7 @@ for ((i = 0; i < $numImageFiles; i++)); do
hg cp support/$imageFileName $imageDest
done
# Add comment & default-preferences line to reftest.list in dest directory:
# Add comment to reftest.list in dest directory:
reftestListFileName="$XUL_REFTEST_PATH/reftest.list"
echo "
# Tests for XUL <image> with 'object-fit' & 'object-position':

Просмотреть файл

@ -398,28 +398,6 @@ must be one of the following:
manifest, a blank defaults line directly preceding the include can be used to
reset the defaults.
5. Specification of default preferences
default-preferences <preference>*
where <preference> is defined above.
The <preference> settings will be used for all following test items in the
manifest.
If a test item includes its own preference settings, then they will override
any settings for preferences of the same names that are set using
default-preferences, just as later items within a line override earlier ones.
A default-preferences line with no <preference> settings following it will
reset the set of default preferences to be empty.
As with url-prefix, default-preferences will often be used at the start of a
manifest file so that it applies to all test items, but it is legal for
default-preferences to appear anywhere in the manifest. A subsequent
default-preferences will reset any previous default preference values and
overwrite them with the specified <preference> values.
This test manifest format could be used by other harnesses, such as ones
that do not depend on XUL, or even ones testing other layout engines.

Просмотреть файл

@ -104,30 +104,6 @@ function ReadManifest(aURL, aFilter, aManifestID)
continue;
}
if (items[0] == "default-preferences") {
var m;
var item;
defaultTestPrefSettings = [];
defaultRefPrefSettings = [];
items.shift();
while ((item = items.shift())) {
if (!(m = item.match(RE_PREF_ITEM))) {
throw "Unexpected item in default-preferences list in manifest file " + aURL.spec + " line " + lineNo;
}
if (!AddPrefSettings(m[1], m[2], m[3], GetOrCreateSandbox(),
defaultTestPrefSettings,
defaultRefPrefSettings)) {
throw "Error in pref value in manifest file " + aURL.spec + " line " + lineNo;
}
}
if (g.compareRetainedDisplayLists) {
AddRetainedDisplayListTestPrefs(GetOrCreateSandbox(),
defaultTestPrefSettings,
defaultRefPrefSettings);
}
continue;
}
var expected_status = EXPECTED_PASS;
var allow_silent_fail = false;
var minAsserts = 0;

Просмотреть файл

@ -149,9 +149,6 @@ class ReftestManifest(object):
urlprefix = items[i+1]
break
if item == 'default-preferences':
break
if item == 'include':
self.load(os.path.join(mdir, items[i+1]))
break

Просмотреть файл

@ -22,7 +22,7 @@ else
fi
rsync -avz --delete --filter=". ./sync-tests-filter" "$MOZTREE"/layout/reftests/w3c-css/submitted/ ./
sed -i -e 's/^\(\(fails\|needs-focus\|random\|skip\|asserts\|slow\|require-or\|silentfail\|pref\|test-pref\|ref-pref\|fuzzy\)[^ ]* *\?\)\+//;/^defaults /d;/^default-preferences /d;s/ \?# \?\(TC: \)\?[bB]ug.*//' $(find . -name reftest.list)
sed -i -e 's/^\(\(fails\|needs-focus\|random\|skip\|asserts\|slow\|require-or\|silentfail\|pref\|test-pref\|ref-pref\|fuzzy\)[^ ]* *\?\)\+//;/^defaults /d;s/ \?# \?\(TC: \)\?[bB]ug.*//' $(find . -name reftest.list)
sed -i -e 's/-moz-crisp-edges/pixelated/g' $(find . -regex ".*\.\(xht\|xhtml\|html\|css\)")
git add -A .
git commit -m"Sync Mozilla CSS tests as of https://hg.mozilla.org/mozilla-central/rev/$MOZREV ." -e .