From a26901ec0ae5f1610b6c9c24c9260ea5fc70ddd9 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Fri, 12 Jun 2015 11:40:36 -0700 Subject: [PATCH] Bug 1170052 part 3: Add scripts to generate reftests for object-fit/object-position applied to XUL . (NPOTB) --- .../xul/generate-object-fit-xul-tests.sh | 95 +++++++++++++++++++ .../xul/generate-object-position-xul-tests.sh | 68 +++++++++++++ 2 files changed, 163 insertions(+) create mode 100644 layout/reftests/xul/generate-object-fit-xul-tests.sh create mode 100644 layout/reftests/xul/generate-object-position-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 000000000000..f524d3b2cf27 --- /dev/null +++ b/layout/reftests/xul/generate-object-fit-xul-tests.sh @@ -0,0 +1,95 @@ +#!/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 & default-preferences line 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. +default-preferences test-pref(layout.css.object-fit-and-position.enabled,true)"\ + >> $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