From 00bfea19b748e90a1b989582dff369e67afc9671 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Mon, 6 Nov 2023 11:58:19 +0100 Subject: [PATCH] test: add WPT report test duration --- test/common/wpt.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/common/wpt.js b/test/common/wpt.js index 34436639dc3185..7d0b030614b003 100644 --- a/test/common/wpt.js +++ b/test/common/wpt.js @@ -59,10 +59,13 @@ function codeUnitStr(char) { } class ReportResult { + #startTime; + constructor(name) { this.test = name; this.status = 'OK'; this.subtests = []; + this.#startTime = Date.now(); } addSubtest(name, status, message) { @@ -81,6 +84,7 @@ class ReportResult { finish(status) { this.status = status ?? 'OK'; + this.duration = Date.now() - this.#startTime; } }