It doesn't look like there's a reliable way to test setTimeout throttling prevention. The underlying behavior is too nondeterministic. This test failed at a significant rate in browsers where throttling prevention worked, simply due to setTimeout taking longer than expected (e.g. 130ms for the entire test vs an expected <= 5oms). When run in Safari, where setTimeout throttling prevention doesn't work, it would incorrectly pass if run early enough in the test order. This is presumably because setTimeout throttling is influenced by the setTimeout calls made by Jasmine itself prior to running the test.
35 KiB
35 KiB