diff --git a/test/common/testlib.py b/test/common/testlib.py index 8bb5dc282374..be16c65bd372 100644 --- a/test/common/testlib.py +++ b/test/common/testlib.py @@ -1380,10 +1380,15 @@ def relative_clips(sels: Collection[str]) -> Collection[tuple[int, int, int, int ret = self.bidi("browsingContext.captureScreenshot", quiet=True, context=self.driver.top_context, clip=rect) + png_now = base64.standard_b64decode(ret["data"]) if ret1["data"] != ret["data"]: print("WARNING: Inconsistent screenshots for", base) - png_now = base64.standard_b64decode(ret["data"]) - png_ref = os.path.exists(ref_filename) and open(ref_filename, "rb").read() + # XXX - for temporarily seeing what kind of inconsistencies we actually get + png_ref = base64.standard_b64decode(ret1["data"]) + inconsistent = True + else: + png_ref = os.path.exists(ref_filename) and open(ref_filename, "rb").read() + inconsistent = False if not png_ref: with open(filename, 'wb') as f: f.write(png_now) @@ -1455,10 +1460,10 @@ def img_eq(ref: Image.Image, now: Image.Image, delta: Image.Image) -> bool: assert isinstance(now_pixel, tuple) if ref_pixel != now_pixel: - if ( + if (not inconsistent and ( masked(ref_pixel) or ignorable_coord(x, y) or - ignorable_change(ref_pixel, now_pixel) + ignorable_change(ref_pixel, now_pixel)) ): data_delta[x, y] = (0, 255, 0, 255) else: