Chrome Version: Linux ToT
What steps will reproduce the problem?
(1) Run the following layout test with content_shell --run-layout-test --enable-leak-detection.
You may need to modify paths to testharness.js and testharnessreport.js to your local path.
<!doctype html>
<script src="testharness.js"></script>
<script src="testharnessreport.js"></script>
<script>
const t = async_test();
// The presense or value of timeout is irrelevant to the repro of this bug.
requestIdleCallback(() => {}, {timeout: 100});
t.done();
</script>
What is the expected result?
Test passes
What happens instead?
Test leaks: ({"numberOfLiveSuspendableObjects":[2,3]})
This bug blocks the implementation of idle time spell checker, which requests idle callbacks within Blink.
Comment 1 by xiaoche...@chromium.org
, Dec 21 2016Also tried with requestAnimationFrame and setTimeout: <!doctype html> <script src="testharness.js"></script> <script src="testharnessreport.js"></script> <script> const t = async_test(); // The presense or value of timeout is irrelevant to the repro of this bug. requestIdleCallback(() => {}, {timeout: 100}); requestAnimationFrame(() => {console.log('rAF')}); setTimeout(() => {console.log('setTimeout 0')}, 0); setTimeout(() => {console.log('setTimeout 5000')}, 5000); t.done(); </script> Result: - rAF always gets invoked and doesn't cause leak - setTimeout may or may not be invoked, depending on its timeout; It doesn't cause leak in either case Guess we need some similar cleanup to idle callbacks at the end of each layout test