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 targos committed Nov 14, 2023
1 parent 4cbe44e commit 6ed8fbf
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 6ed8fbf

Please sign in to comment.