Skip to content

Commit

Permalink
test: add WPT report test duration
Browse files Browse the repository at this point in the history
PR-URL: #50574
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
  • Loading branch information
panva authored and UlisesGascon committed Dec 11, 2023
1 parent 39cc013 commit 4349790
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/common/wpt.js
Expand Up @@ -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) {
Expand All @@ -81,6 +84,7 @@ class ReportResult {

finish(status) {
this.status = status ?? 'OK';
this.duration = Date.now() - this.#startTime;
}
}

Expand Down

0 comments on commit 4349790

Please sign in to comment.