Bug 1006123, part 2: Add reftest for high-quality image downscaling. r=seth

This commit is contained in:
Daniel Holbert 2014-05-22 09:44:05 -07:00
Родитель 0014fc1ded
Коммит 4296ce21ad
6 изменённых файлов: 63 добавлений и 0 удалений

Двоичные данные
image/test/reftest/downscaling/downscale-1-bigimage.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 195 B

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

@ -0,0 +1,8 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html>
<body>
<img src="downscale-1-smallimage.png">
</body>
</html>

Двоичные данные
image/test/reftest/downscaling/downscale-1-smallimage.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 88 B

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

@ -0,0 +1,24 @@
<!DOCTYPE html>
<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
<html class="reftest-wait">
<head>
<script>
function snapshot() {
document.documentElement.removeAttribute('class');
}
</script>
</head>
<!-- NOTE: Using setTimeout to wait for high-quality downscaled version of
image to be ready, because there's nothing better we can do. If we fix
Bug 1006883, we can do away with this setTimeout.
For now, the setTimeout is just here to increase the likelihood that we
actually test the high-quality downscaled version of the image. If the
setTimeout happens to fire before the high-quality downscaled rendering is
ready, then this the test will pass without testing what it's trying to
test, which is fine as long as that's rare. -->
<body onload="setTimeout(snapshot, 50)">
<img src="downscale-1-bigimage.png" style="height: 20px; width: 20px">
</body>
</html>

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

@ -0,0 +1,28 @@
# Reftests for downscaling
#
# Downscaling can be a lossy process, so a bit of mismatch is acceptable here,
# as long as it's barely noticable visually. When necessary, this can be
# explicitly allowed via 'fuzzy'/'fuzzy-if' annotations.
#
# 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
# simply appending a new test to the lists below each of those lines should be
# sufficient.
#
# Also note that Mac OS X has its own system-level downscaling algorithm, so
# tests here may need Mac-specific "fuzzy-if(cocoaWidget,...)" annotations.
# RUN TESTS WITH HIGH QUALITY DOWNSCALING DISABLED:
# =================================================
default-preferences pref(image.high_quality_downscaling.enabled,false)
fuzzy-if(cocoaWidget,106,31) == downscale-1.html downscale-1-ref.html
# RUN TESTS WITH HIGH QUALITY DOWNSCALING ENABLED:
# ================================================
# High-quality downscaling enabled:
default-preferences pref(image.high_quality_downscaling.enabled,true)
fuzzy(31,127) == downscale-1.html downscale-1-ref.html

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

@ -43,5 +43,8 @@ include generic/reftest.list
# Color management test
include color-management/reftest.list
# Downscaling tests
include downscaling/reftest.list
# Lossless encoders
skip-if(Android||B2G) include encoders-lossless/reftest.list # bug 783621