Bug 1287019 - part1: make mozlog's HTML format support wptrunner screenshot.
Current mozlog (v3.2) doesn't support screenshot logs exported from wptrunner.
Add this support so we could run css test with --log-html to see more detail
information, such as screenshots of test/reference pages.
DONTBUILD (NPOTB)
MozReview-Commit-ID: AUJwYfvNfda
--- a/testing/mozbase/mozlog/mozlog/formatters/html/html.py
+++ b/testing/mozbase/mozlog/mozlog/formatters/html/html.py
@@ -92,16 +92,26 @@ class HTMLFormatter(base.BaseFormatter):
def test_end(self, data):
self.make_result_html(data)
def make_result_html(self, data):
tc_time = (data["time"] - self.start_times.pop(data["test"])) / 1000.
additional_html = []
debug = data.get("extra", {})
+ # Add support for log exported from wptrunner. The structure of
+ # reftest_screenshots is listed in wptrunner/executors/base.py.
+ if debug.get('reftest_screenshots'):
+ log_data = debug.get("reftest_screenshots", {})
+ debug = {
+ 'image1':'data:image/png;base64,' + log_data[0].get("screenshot", {}),
+ 'image2':'data:image/png;base64,' + log_data[2].get("screenshot", {}),
+ 'differences': "Not Implemented",
+ }
+
links_html = []
status = status_name = data["status"]
expected = data.get("expected", status)
if status != expected:
status_name = "UNEXPECTED_" + status
elif status not in ("PASS", "SKIP"):