From 26ffcd17687ff59abccf3822aa0afb344c34e9b9 Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Tue, 13 Sep 2022 18:28:31 +0000 Subject: [PATCH] CTS: Allow sync code to interrupt and cancel a scheduled heartbeat Bug: chromium:1340602 Change-Id: Id6f8d58bd283c8232af533cf2a0fe74adb704336 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/102180 Reviewed-by: Ben Clayton Commit-Queue: Austin Eng Kokoro: Kokoro --- webgpu-cts/test_runner.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/webgpu-cts/test_runner.js b/webgpu-cts/test_runner.js index 9d1baf3e36..ed9e06ad5f 100644 --- a/webgpu-cts/test_runner.js +++ b/webgpu-cts/test_runner.js @@ -37,9 +37,8 @@ function rateLimited(fn, intervalMs) { let last = undefined; let timer = undefined; const wrappedFn = (...args) => { - if (timer !== undefined || last === undefined) { - // If there is already a fn call scheduled, or the function is - // not enabled, return. + if (last === undefined) { + // If the function is not enabled, return. return; } // Get the current time as a number.