mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
auto merge of #3645 : gilles-leblanc/servo/issue-3481, r=kmcallister
In the test harness, assert that the two images aren't all white. Fixes #3481
This commit is contained in:
commit
c9ce56a85d
7 changed files with 13 additions and 2 deletions
|
@ -15,7 +15,7 @@
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id=a></div>
|
<div id=a>Background: none test</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id=a></div>
|
<div id=a>Background: none test</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
iframe test
|
||||||
<iframe sandbox="allow-scripts" src="multiple_external_child.html"> </iframe>
|
<iframe sandbox="allow-scripts" src="multiple_external_child.html"> </iframe>
|
||||||
<iframe sandbox="allow-scripts" src="multiple_external_child.html"> </iframe>
|
<iframe sandbox="allow-scripts" src="multiple_external_child.html"> </iframe>
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<body>
|
<body>
|
||||||
|
iframe test
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
|
Image dynamic remove
|
||||||
<img src=400x400_green.png>
|
<img src=400x400_green.png>
|
||||||
<script>
|
<script>
|
||||||
document.getElementsByTagName("img")[0].removeAttribute("src");
|
document.getElementsByTagName("img")[0].removeAttribute("src");
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
|
Image dynamic remove
|
||||||
<img>
|
<img>
|
||||||
|
|
|
@ -259,6 +259,13 @@ fn check_reftest(reftest: Reftest) {
|
||||||
assert_eq!(left_width, right_width);
|
assert_eq!(left_width, right_width);
|
||||||
assert_eq!(left_height, right_height);
|
assert_eq!(left_height, right_height);
|
||||||
|
|
||||||
|
let left_all_white = left_bytes.iter().all(|&p| p == 255);
|
||||||
|
let right_all_white = right_bytes.iter().all(|&p| p == 255);
|
||||||
|
|
||||||
|
if left_all_white && right_all_white {
|
||||||
|
fail!("Both rendering are empty")
|
||||||
|
}
|
||||||
|
|
||||||
let pixels = left_bytes.iter().zip(right_bytes.iter()).map(|(&a, &b)| {
|
let pixels = left_bytes.iter().zip(right_bytes.iter()).map(|(&a, &b)| {
|
||||||
if a as i8 - b as i8 == 0 {
|
if a as i8 - b as i8 == 0 {
|
||||||
// White for correct
|
// White for correct
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue