Report javascript duration in CTS tooling

Always report the Javascript duration from the page instead of
the total duration from ResultDB. Reporting of the total duration
could be added back in the future, but usages of the tooling are
currently interested in the Javascript duration.

Bug: chromium:1336333
Change-Id: I74e91e7a9c29f3a4c45ed67898cc6f2de62e19a4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/94762
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Austin Eng <enga@chromium.org>
diff --git a/tools/src/cmd/cts/common/results.go b/tools/src/cmd/cts/common/results.go
index 934195e..da76147 100644
--- a/tools/src/cmd/cts/common/results.go
+++ b/tools/src/cmd/cts/common/results.go
@@ -218,13 +218,20 @@
 		status := toStatus(rpb.Status)
 		tags := result.NewTags()
 
+		duration := rpb.GetDuration().AsDuration()
+
 		for _, sp := range rpb.Tags {
 			if sp.Key == "typ_tag" {
 				tags.Add(sp.Value)
 			}
+			if sp.Key == "javascript_duration" {
+				var err error
+				if duration, err = time.ParseDuration(sp.Value); err != nil {
+					return err
+				}
+			}
 		}
 
-		duration := rpb.GetDuration().AsDuration()
 		if status == result.Pass && duration > cfg.Test.SlowThreshold {
 			status = result.Slow
 		}