From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../reftests/xul/generate-object-fit-xul-tests.sh | 94 ++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 layout/reftests/xul/generate-object-fit-xul-tests.sh (limited to 'layout/reftests/xul/generate-object-fit-xul-tests.sh') diff --git a/layout/reftests/xul/generate-object-fit-xul-tests.sh b/layout/reftests/xul/generate-object-fit-xul-tests.sh new file mode 100644 index 0000000000..624b2e73ef --- /dev/null +++ b/layout/reftests/xul/generate-object-fit-xul-tests.sh @@ -0,0 +1,94 @@ +#!/bin/bash +# +# Any copyright is dedicated to the Public Domain. +# http://creativecommons.org/publicdomain/zero/1.0/ +# +# Script to generate XUL reftest files, from corresponding reftest +# files that use . +# +# This script expects to be run from this working directory: +# mozilla-central/layout/reftests/w3c-css/submitted/images3 + +XUL_REFTEST_PATH="../../../xul" + +imageFileArr=("colors-16x8.png" "colors-8x16.png" + "colors-16x8.svg" "colors-8x16.svg" + "colors-16x8-noSize.svg" "colors-8x16-noSize.svg" + "colors-16x8-parDefault.svg" "colors-8x16-parDefault.svg") +numImageFiles=${#imageFileArr[@]} + +# Copy image files +for ((i = 0; i < $numImageFiles; i++)); do + imageFileName=${imageFileArr[$i]} + imageDest=$XUL_REFTEST_PATH/$imageFileName + + echo "Copying $imageDest." + hg cp support/$imageFileName $imageDest +done + +# Add comment to reftest.list in dest directory: +reftestListFileName="$XUL_REFTEST_PATH/reftest.list" +echo " +# Tests for XUL with 'object-fit' & 'object-position': +# These tests should be very similar to tests in our w3c-css/submitted/images3 +# reftest directory. They live here because they use XUL, and it +# wouldn't be fair of us to make a W3C testsuite implicitly depend on XUL."\ + >> $reftestListFileName + +# Loop across all object-fit tests that use ("i" suffix): +for origTestName in object-fit*i.html; do + newTestName=$(echo $origTestName | + sed "s/i.html/.xul/") + + # Find the corresponding reference case: + referenceName=$(echo $origTestName | + sed "s/i.html/-ref.html/") + + # Generate reference file (dropping "support" subdir from image paths): + echo "Copying $referenceName to $XUL_REFTEST_PATH." + newReferenceFullPath=$XUL_REFTEST_PATH/$referenceName + hg cp $referenceName $newReferenceFullPath + sed -i "s,support/,," $newReferenceFullPath + + # Generate testcase + # (converting