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 <[email protected]>
Reviewed-By: Moshe Atlow <[email protected]>
Reviewed-By: Chengzhong Wu <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
  • 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
Original file line number Diff line number Diff line change
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.