Skip to content

Commit

Permalink
rIC: change deadline-after-expired-timer.html asserts
Browse files Browse the repository at this point in the history
This CL changes the test expectation that the deadline is positive when
an idle callback runs after a timer expires to non-negative (which
matches the test title). On slow or overloaded machines, it's possible
for the deadline to be reached while running the callback, in which
case the deadline.timeRemaining() will be 0 and the test will fail.
Per spec, the timeRemaining() must never be < 0, but 0 is valid in this
test, so this changes the assertion to greater_than_equal.

Bug: 1329281
Change-Id: Ie0d42e7fd0b47579edc72ae5a7889e2e8475b266
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4622374
Commit-Queue: Scott Haseley <[email protected]>
Reviewed-by: Noam Rosenthal <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1160116}
  • Loading branch information
shaseley authored and chromium-wpt-export-bot committed Jun 20, 2023
1 parent 9873523 commit 03365e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion requestidlecallback/deadline-after-expired-timer.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
requestIdleCallback(
t.step_func((deadline) => {
assert_false(deadline.didTimeout);
assert_greater_than(deadline.timeRemaining(), 0);
assert_greater_than_equal(deadline.timeRemaining(), 0);
t.done();
}),
{ timeout: 1000 }
Expand Down

0 comments on commit 03365e3

Please sign in to comment.