Bug 1616411 - Part 7: Tests. r=tnikkel

Differential Revision: https://phabricator.services.mozilla.com/D70277
This commit is contained in:
Cameron McCormack 2020-04-17 02:57:49 +00:00
Родитель 78281a4d72
Коммит e91f99f8e1
34 изменённых файлов: 187 добавлений и 95 удалений

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

@ -44,7 +44,7 @@ skip-if(Android) == 649134-2.html 649134-2-ref.html
# (Fuzzy necessary due to pixel-wise comparison of different JPEGs.
# The vast majority of the fuzziness comes from Linux and WinXP.)
pref(layout.css.image-orientation.initial-from-image,true) fuzzy(0-2,0-830) == bug917595-iframe-1.html bug917595-1-ref.html
fuzzy(0-3,0-640) fuzzy-if(skiaContent,0-3,0-7544) fuzzy-if(webrender&&!geckoview,2-3,3092-7544) == bug917595-exif-rotated.jpg bug917595-pixel-rotated.jpg # bug 1060869
fuzzy(0-3,0-640) fuzzy-if(skiaContent,0-3,0-7544) fuzzy-if(webrender&&!geckoview,2-3,52-7544) == bug917595-exif-rotated.jpg bug917595-pixel-rotated.jpg # bug 1060869
# Test support for SVG-as-image in <picture> elements.
== bug1106522-1.html bug1106522-ref.html

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

@ -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="image-pre-rotated-90-deg.jpg" style="width: 50px; height: 25px;">
</body>
</html>

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

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

После

Ширина:  |  Высота:  |  Размер: 146 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="../../../../layout/reftests/image/image-exif-90-deg.jpg" style="width: 50px; height: 25px;">
</body>
</html>

Двоичные данные
image/test/reftest/downscaling/image-pre-rotated-90-deg.jpg Normal file

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

После

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

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

@ -110,6 +110,9 @@ fuzzy(0-1,0-1024) == downscale-32px.html?.jpg downscale-32px-ref.html
== downscale-32px.html?-bmp-in.ico downscale-32px-ref.html
== downscale-32px.html?-png-in.ico downscale-32px-ref.html
# Test downscaling a JPEG with orientation metadata.
pref(layout.css.image-orientation.initial-from-image,true) fuzzy(0-1,0-50) == downscale-orient.html downscale-orient-ref.html
# RUN TESTS WITH DOWNSCALE-DURING-DECODE ENABLED:
# ===============================================
defaults pref(image.downscale-during-decode.enabled,true)
@ -196,6 +199,9 @@ fuzzy(0-18,0-128) == downscale-32px.html?.png downscale-32px-ref.html
fuzzy(0-18,0-128) == downscale-32px.html?-bmp-in.ico downscale-32px-ref.html
fuzzy(0-18,0-128) == downscale-32px.html?-png-in.ico downscale-32px-ref.html
# Test downscaling a JPEG with orientation metadata.
pref(layout.css.image-orientation.initial-from-image,true) fuzzy(0-4,0-15) == downscale-orient.html downscale-orient-ref.html
# Test images taller or wider than 32767 pixels.
== huge-1.html?100x32768.png,100,100 huge-1.html?100x100.png,100,100
== huge-1.html?100x32768.png,100,32768 huge-1.html?100x100.png,100,32768

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

@ -0,0 +1,3 @@
<!DOCTYPE html>
<div style="width: 200px; height: 100px;"><img src="../image/image-exif-90-deg.jpg"></div>
<img src="../image/image-exif-90-deg.jpg">

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

@ -0,0 +1,4 @@
<!DOCTYPE html>
<!-- Test that -moz-element() honors a target image's orientation metadata. -->
<div style="width: 200px; height: 100px; background-image: -moz-element(#e);"></div>
<img id="e" src="../image/image-exif-90-deg.jpg">

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

@ -49,5 +49,5 @@ HTTP == invalidate-1.html invalidate-1-ref.html
== empty-src.html no-src.html
== broken-icon.html invalid-src.html
fails == invalid-src.html invalid-src-2.html # bug 1506804
fuzzy-if(skiaContent,0-1,0-30000) == mask-image-element.html mask-image-element-ref.html
pref(image.honor-orientation-metadata,true) pref(layout.css.image-orientation.initial-from-image,true) == orientation-1.html orientation-1-ref.html

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

@ -1,41 +0,0 @@
<!DOCTYPE>
<head>
<style>
body {
border: 0px;
margin: 0px;
padding: 0px;
}
div {
width: 100px;
height: 100px;
margin: 50px;
/* This is deliberately an image with a non-neutral inherent orientation to */
/* ensure that the inherent orientation is irrelevant. */
border-style: solid;
border-width: 20px;
border-image: url(image-exif-90-deg-flip.jpg) 27 repeat;
}
</style>
</head>
<body>
<div></div>
<script>
var fromImage = location.search == "from-image";
// Construct a style.
var style;
if (fromImage) {
style = "div { image-orientation: from-image; }\n";
} else {
style = "div { image-orientation: none; }\n";
}
// Apply the style to the document.
var sheet = document.createElement('style');
sheet.innerHTML = style;
document.body.appendChild(sheet);
</script>
</body>

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

@ -1,39 +0,0 @@
<!DOCTYPE>
<head>
<style>
body {
border: 0px;
margin: 0px;
padding: 0px;
}
ul {
list-style-position: inside;
list-style-image: url(image-exif-270-deg-flip.jpg);
}
</style>
</head>
<body>
<ul><li></li></ul>
<script>
var orientation = location.search.substring(1).split("&");
var angle = orientation[0];
var flip = orientation[1] == "flip" ? true : false;
// Construct a style. "from-image" is special-cased.
var style;
if (angle == "from-image") {
style = "ul { image-orientation: from-image; }\n";
} else {
style = "ul { image-orientation: "
+ angle + "deg"
+ (flip ? " flip" : "")
+ "; }\n";
}
// Apply the style to the document.
var sheet = document.createElement('style');
sheet.innerHTML = style;
document.body.appendChild(sheet);
</script>
</body>

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

@ -38,11 +38,6 @@ fuzzy(0-1,0-1) == image-orientation-explicit-none.html image-orientation-ref.htm
# Tests for image-orientation:from-image used on generated content:
fuzzy(0-1,0-1) == image-orientation-generated-content.html image-orientation-generated-content-ref.html
# Tests that image-orientation does not apply to decorative images:
fuzzy(0-1,0-1) == image-orientation-background.html?from-image image-orientation-ref.html?none
== image-orientation-border-image.html?from-image image-orientation-border-image.html?none
== image-orientation-list-style-image.html?from-image image-orientation-list-style-image.html?none
fuzzy(0-1,0-1) == image-orientation-dynamic.html image-orientation-dynamic-ref.html
# <img srcset> tests

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

@ -0,0 +1 @@
prefs: [layout.css.image-orientation.initial-from-image:true, image.honor-orientation-metadata:true]

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

@ -0,0 +1,2 @@
[drawImage-from-bitmap-orientation-none.tentative.html]
expected: FAIL

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

@ -0,0 +1,2 @@
[drawImage-from-bitmap-swap-width-height-orientation-none.tentative.html]
expected: FAIL

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

@ -1,2 +0,0 @@
[drawImage-from-bitmap-swap-width-height.tentative.html]
expected: FAIL

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

@ -1,2 +0,0 @@
[drawImage-from-bitmap.tentative.html]
expected: FAIL

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

@ -0,0 +1,2 @@
[drawImage-from-element-orientation-none.tentative.html]
expected: FAIL

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

@ -0,0 +1,2 @@
[drawImage-from-element-swap-width-height-orientation-none.tentative.html]
expected: FAIL

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

@ -1,2 +0,0 @@
[drawImage-from-element-swap-width-height.tentative.html]
expected: FAIL

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

@ -1,2 +0,0 @@
[drawImage-from-element.tentative.html]
expected: FAIL

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

@ -1 +1,2 @@
leak-threshold: [default:51200]
prefs: [image.honor-orientation-metadata:true, layout.css.image-orientation.initial-from-image:true]

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

@ -0,0 +1,2 @@
[image-orientation-background-image.html]
fuzzy: 2;40

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

@ -0,0 +1,2 @@
[image-orientation-border-image.html]
fuzzy: 0-16;80-160

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

@ -0,0 +1,2 @@
[image-orientation-list-style-image.html]
fuzzy: 0-4;0-41

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

@ -0,0 +1,2 @@
[image-orientation-mask-image.html]
fuzzy: 1;22

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

@ -0,0 +1,13 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Images Module Level 3: image-orientation does not apply to background-image</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation">
<link rel="match" href="reference/image-orientation-background-image-ref.html">
<meta name=fuzzy content="2;40">
<style>
div { width: 100px; height: 50px; background-image: url(support/exif-orientation-2-ur.jpg); }
.no-orient { image-orientation: none; }
</style>
<div></div>
<div class="no-orient"></div>

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

@ -0,0 +1,17 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Images Module Level 3: image-orientation does not apply to border images</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation">
<link rel="match" href="reference/image-orientation-border-image-ref.html">
<style>
div {
width: 100px;
height: 50px;
border: 10px solid black;
border-image: url(support/exif-orientation-2-ur.jpg) 10;
}
.no-orient { image-orientation: none; }
</style>
<div></div>
<div class="no-orient"></div>

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

@ -0,0 +1,13 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Images Module Level 3: image-orientation does not apply to list-style-image</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation">
<link rel="match" href="reference/image-orientation-list-style-image-ref.html">
<meta name=fuzzy content="2;40">
<style>
ul { margin-left: 100px; list-style-image: url(support/exif-orientation-2-ur.jpg); }
.no-orient { image-orientation: none; }
</style>
<ul><li>&nbsp;</li></ul>
<ul class="no-orient"><li>&nbsp;</li></ul>

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

@ -0,0 +1,19 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Images Module Level 3: image-orientation does not apply to mask-image</title>
<link rel="author" title="Cameron McCormack" href="mailto:cam@mcc.id.au">
<link rel="help" href="https://drafts.csswg.org/css-images-3/#propdef-image-orientation">
<link rel="match" href="reference/image-orientation-mask-image-ref.html">
<meta name=fuzzy content="1;22">
<style>
div {
width: 100px;
height: 50px;
background: blue;
mask-image: url(support/exif-orientation-2-ur.jpg);
mask-mode: luminance;
}
.no-orient { image-orientation: none; }
</style>
<div></div>
<div class="no-orient"></div>

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

@ -0,0 +1,9 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Reference</title>
<style>
div { width: 100px; height: 50px; background-image: url(../support/exif-orientation-2-ur-pre-rotated.jpg); }
</style>
<div></div>
<div></div>

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

@ -0,0 +1,13 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Reference</title>
<style>
div {
width: 100px;
height: 50px;
border: 10px solid black;
border-image: url(../support/exif-orientation-2-ur-pre-rotated.jpg) 10;
}
</style>
<div></div>
<div></div>

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

@ -0,0 +1,8 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Reference</title>
<style>
ul { margin-left: 100px; list-style-image: url(../support/exif-orientation-2-ur-pre-rotated.jpg); }
</style>
<ul><li>&nbsp;</li></ul>
<ul><li>&nbsp;</li></ul>

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

@ -0,0 +1,14 @@
<!DOCTYPE html>
<meta charset="utf-8">
<title>CSS Reference</title>
<style>
div {
width: 100px;
height: 50px;
background: blue;
mask-image: url(../support/exif-orientation-2-ur-pre-rotated.jpg);
mask-mode: luminance;
}
</style>
<div></div>
<div></div>