Bug 1098417 part 5: Add reftests for anchor-point handling, with WebM videos & a range of "object-position" values. (no review)

--HG--
rename : layout/reftests/webm-video/generate-object-fit-video-tests.sh => layout/reftests/webm-video/generate-object-position-video-tests.sh
rename : layout/reftests/w3c-css/submitted/images3/object-position-png-001-ref.html => layout/reftests/webm-video/object-position-webm-001-ref.html
rename : layout/reftests/w3c-css/submitted/images3/object-position-png-001p.html => layout/reftests/webm-video/object-position-webm-001.html
rename : layout/reftests/w3c-css/submitted/images3/object-position-png-002-ref.html => layout/reftests/webm-video/object-position-webm-002-ref.html
rename : layout/reftests/w3c-css/submitted/images3/object-position-png-002p.html => layout/reftests/webm-video/object-position-webm-002.html
This commit is contained in:
Daniel Holbert 2014-11-25 16:46:15 -08:00
Родитель 447cfc6303
Коммит 28cfe08fd0
6 изменённых файлов: 252 добавлений и 0 удалений

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

@ -0,0 +1,78 @@
#!/bin/bash
#
# Any copyright is dedicated to the Public Domain.
# http://creativecommons.org/publicdomain/zero/1.0/
#
# Script to generate <video src> reftest files, from corresponding reftest
# files that use <video poster>.
#
# This script expects to be run from this working directory:
# mozilla-central/layout/reftests/w3c-css/submitted/images3
#
# It requires that the tools png2yuv and vpxenc be available, from the
# Ubuntu packages 'mjpegtools' and 'vpx-tools'. More info here:
# http://wiki.webmproject.org/howtos/convert-png-frames-to-webm-video
VIDEO_REFTEST_PATH="../../../webm-video"
imageFileArr=("colors-16x8.png" "colors-8x16.png")
numImageFiles=${#imageFileArr[@]}
# Copy image files, and generate webm files:
for ((i = 0; i < $numImageFiles; i++)); do
imageFileName=${imageFileArr[$i]}
imageDest=$VIDEO_REFTEST_PATH/$imageFileName
echo "Copying $imageDest."
hg cp support/$imageFileName $imageDest
videoDest=`echo $imageDest | sed "s/png/webm/"`
echo "Generating $videoDest."
png2yuv -f 1 -I p -b 1 -n 1 -j $imageDest \
| vpxenc --passes=1 --pass=1 --codec=vp9 --lossless=1 --max-q=0 -o $videoDest -
hg add $videoDest
done
reftestListFileName="$VIDEO_REFTEST_PATH/reftest.list"
# Loop across all <video poster> tests:
for origTestName in object-position-png-*p.html; do
# Find the corresponding reference case:
origReferenceName=$(echo $origTestName |
sed "s/p.html/-ref.html/")
# The generated testcase will have "-webm" instead of "-png", and unlike
# the original png test, it won't have a single-letter suffix to indicate the
# particular container element. (since it's unnecessary -- there's only one
# possible container element for webm, "<video>")
videoTestName=$(echo $origTestName |
sed "s/png/webm/" |
sed "s/p.html/.html/")
videoReferenceName=$(echo $videoTestName |
sed "s/.html/-ref.html/")
# Generate reference file (dropping "support" subdir from image paths):
echo "Copying $origReferenceName to $VIDEO_REFTEST_PATH."
videoReferenceFullPath=$VIDEO_REFTEST_PATH/$videoReferenceName
hg cp $origReferenceName $videoReferenceFullPath
sed -i "s,support/,," $videoReferenceFullPath
# Generate testcase
# (converting <video poster="support/foo.png"> to <video src="foo.webm">):
echo "Generating $videoTestName from $origTestName."
videoTestFullPath=$VIDEO_REFTEST_PATH/$videoTestName
hg cp $origTestName $videoTestFullPath
sed -i "s/PNG image/WebM video/" $videoTestFullPath
sed -i "s/poster/src/" $videoTestFullPath
sed -i "s,support/,," $videoTestFullPath
sed -i "s/png/webm/" $videoTestFullPath
sed -i "s/$origReferenceName/$videoReferenceName/" $videoTestFullPath
# Update reftest manifest:
annotation="fails-if(layersGPUAccelerated) skip-if(Android||B2G)"
comment="# Bug 1098417 for across-the-board failure, Bug 1083516 for layersGPUAccelerated failures, Bug 1084564 for Android/B2G failures"
echo "$annotation == $videoTestName $videoReferenceName $comment" \
>> $reftestListFileName
done

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

@ -0,0 +1,42 @@
<!DOCTYPE html>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<head>
<meta charset="utf-8">
<title>CSS Reftest Reference</title>
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
<style type="text/css">
div {
background: lightgray;
margin-right: 2px;
background-image: url("colors-16x8.png");
background-size: contain;
background-repeat: no-repeat;
float: left;
width: 20px;
height: 20px;
}
.op_y-7 { background-position: 50% -7% }
.op_y13 { background-position: 50% 13% }
.op_y23 { background-position: 50% 23% }
.op_y50 { background-position: 50% 50% }
.op_y75 { background-position: 50% 75% }
.op_y88 { background-position: 50% 88% }
.op_y111 { background-position: 50% 111% }
</style>
</head>
<body>
<div class="op_y-7"></div>
<div class="op_y13"></div>
<div class="op_y23"></div>
<div class="op_y50"></div>
<div class="op_y75"></div>
<div class="op_y88"></div>
<div class="op_y111"></div>
</body>
</html>

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

@ -0,0 +1,44 @@
<!DOCTYPE html>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<head>
<meta charset="utf-8">
<title>CSS Test: various 'object-position' values on a fixed-size video element, with a WebM video and 'object-fit:contain'.</title>
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
<link rel="help" href="http://www.w3.org/TR/css3-images/#sizing">
<link rel="help" href="http://www.w3.org/TR/css3-images/#the-object-fit">
<link rel="help" href="http://www.w3.org/TR/css3-images/#the-object-position">
<link rel="match" href="object-position-webm-001-ref.html">
<style type="text/css">
video {
background: lightgray;
margin-right: 2px;
object-fit: contain;
float: left;
width: 20px;
height: 20px;
}
.op_y-7 { object-position: 50% -7% }
.op_y13 { object-position: 50% 13% }
.op_y23 { object-position: 50% 23% }
.op_y50 { object-position: 50% 50% }
.op_y75 { object-position: 50% 75% }
.op_y88 { object-position: 50% 88% }
.op_y111 { object-position: 50% 111% }
</style>
</head>
<body>
<video src="colors-16x8.webm" class="op_y-7"></video>
<video src="colors-16x8.webm" class="op_y13"></video>
<video src="colors-16x8.webm" class="op_y23"></video>
<video src="colors-16x8.webm" class="op_y50"></video>
<video src="colors-16x8.webm" class="op_y75"></video>
<video src="colors-16x8.webm" class="op_y88"></video>
<video src="colors-16x8.webm" class="op_y111"></video>
</body>
</html>

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

@ -0,0 +1,42 @@
<!DOCTYPE html>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<head>
<meta charset="utf-8">
<title>CSS Reftest Reference</title>
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
<style type="text/css">
div {
background: lightgray;
margin-right: 2px;
background-image: url("colors-8x16.png");
background-size: contain;
background-repeat: no-repeat;
float: left;
width: 20px;
height: 20px;
}
.op_x-7 { background-position: -7% 50% }
.op_x13 { background-position: 13% 50% }
.op_x23 { background-position: 23% 50% }
.op_x50 { background-position: 50% 50% }
.op_x75 { background-position: 75% 50% }
.op_x88 { background-position: 88% 50% }
.op_x111 { background-position: 111% 50% }
</style>
</head>
<body>
<div class="op_x-7"></div>
<div class="op_x13"></div>
<div class="op_x23"></div>
<div class="op_x50"></div>
<div class="op_x75"></div>
<div class="op_x88"></div>
<div class="op_x111"></div>
</body>
</html>

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

@ -0,0 +1,44 @@
<!DOCTYPE html>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/
-->
<html>
<head>
<meta charset="utf-8">
<title>CSS Test: various 'object-position' values on a fixed-size video element, with a WebM video and 'object-fit:contain'.</title>
<link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com">
<link rel="help" href="http://www.w3.org/TR/css3-images/#sizing">
<link rel="help" href="http://www.w3.org/TR/css3-images/#the-object-fit">
<link rel="help" href="http://www.w3.org/TR/css3-images/#the-object-position">
<link rel="match" href="object-position-webm-002-ref.html">
<style type="text/css">
video {
background: lightgray;
margin-right: 2px;
object-fit: contain;
float: left;
width: 20px;
height: 20px;
}
.op_x-7 { object-position: -7% 50% }
.op_x13 { object-position: 13% 50% }
.op_x23 { object-position: 23% 50% }
.op_x50 { object-position: 50% 50% }
.op_x75 { object-position: 75% 50% }
.op_x88 { object-position: 88% 50% }
.op_x111 { object-position: 111% 50% }
</style>
</head>
<body>
<video src="colors-8x16.webm" class="op_x-7"></video>
<video src="colors-8x16.webm" class="op_x13"></video>
<video src="colors-8x16.webm" class="op_x23"></video>
<video src="colors-8x16.webm" class="op_x50"></video>
<video src="colors-8x16.webm" class="op_x75"></video>
<video src="colors-8x16.webm" class="op_x88"></video>
<video src="colors-8x16.webm" class="op_x111"></video>
</body>
</html>

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

@ -50,3 +50,5 @@ fails-if(layersGPUAccelerated) skip-if(Android||B2G) == object-fit-none-webm-001
fails-if(layersGPUAccelerated) skip-if(Android||B2G) == object-fit-none-webm-002.html object-fit-none-webm-002-ref.html # Bug 1083516 for layersGPUAccelerated failures, Bug 1084564 for Android/B2G failures
fails-if(layersGPUAccelerated) skip-if(Android||B2G) == object-fit-scale-down-webm-001.html object-fit-scale-down-webm-001-ref.html # Bug 1083516 for layersGPUAccelerated failures, Bug 1084564 for Android/B2G failures
fails-if(layersGPUAccelerated) skip-if(Android||B2G) == object-fit-scale-down-webm-002.html object-fit-scale-down-webm-002-ref.html # Bug 1083516 for layersGPUAccelerated failures, Bug 1084564 for Android/B2G failures
fails-if(layersGPUAccelerated) skip-if(Android||B2G) fails == object-position-webm-001.html object-position-webm-001-ref.html # Bug 1098417 for across-the-board failure, Bug 1083516 for layersGPUAccelerated failures, Bug 1084564 for Android/B2G failures
fails-if(layersGPUAccelerated) skip-if(Android||B2G) fails == object-position-webm-002.html object-position-webm-002-ref.html # Bug 1098417 for across-the-board failure, Bug 1083516 for layersGPUAccelerated failures, Bug 1084564 for Android/B2G failures