mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Pass path strings to {load,store}_png directly.
This has been made possible by using the AsPath trait upstream.
This commit is contained in:
parent
561f7e594e
commit
2fde574b39
1 changed files with 4 additions and 6 deletions
|
@ -277,8 +277,7 @@ fn capture(reftest: &Reftest, side: usize) -> (u32, u32, Vec<u8>) {
|
||||||
};
|
};
|
||||||
assert_eq!(retval, ExitStatus(0));
|
assert_eq!(retval, ExitStatus(0));
|
||||||
|
|
||||||
let path = png_filename.parse::<Path>().unwrap();
|
let image = png::load_png(&png_filename).unwrap();
|
||||||
let image = png::load_png(&path).unwrap();
|
|
||||||
let rgba8_bytes = match image.pixels {
|
let rgba8_bytes = match image.pixels {
|
||||||
png::PixelsByColorType::RGBA8(pixels) => pixels,
|
png::PixelsByColorType::RGBA8(pixels) => pixels,
|
||||||
_ => panic!(),
|
_ => panic!(),
|
||||||
|
@ -319,8 +318,7 @@ fn check_reftest(reftest: Reftest) {
|
||||||
}).collect::<Vec<u8>>();
|
}).collect::<Vec<u8>>();
|
||||||
|
|
||||||
if pixels.iter().any(|&a| a < 255) {
|
if pixels.iter().any(|&a| a < 255) {
|
||||||
let output_str = format!("/tmp/servo-reftest-{:06}-diff.png", reftest.id);
|
let output = format!("/tmp/servo-reftest-{:06}-diff.png", reftest.id);
|
||||||
let output = output_str.parse::<Path>().unwrap();
|
|
||||||
|
|
||||||
let mut img = png::Image {
|
let mut img = png::Image {
|
||||||
width: left_width,
|
width: left_width,
|
||||||
|
@ -331,8 +329,8 @@ fn check_reftest(reftest: Reftest) {
|
||||||
assert!(res.is_ok());
|
assert!(res.is_ok());
|
||||||
|
|
||||||
match (reftest.kind, reftest.is_flaky) {
|
match (reftest.kind, reftest.is_flaky) {
|
||||||
(ReftestKind::Same, true) => println!("flaky test - rendering difference: {}", output_str),
|
(ReftestKind::Same, true) => println!("flaky test - rendering difference: {}", output),
|
||||||
(ReftestKind::Same, false) => panic!("rendering difference: {}", output_str),
|
(ReftestKind::Same, false) => panic!("rendering difference: {}", output),
|
||||||
(ReftestKind::Different, _) => {} // Result was different and that's what was expected
|
(ReftestKind::Different, _) => {} // Result was different and that's what was expected
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue