From d46cea9c41e6a77a372db990996e133e39b4d056 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Sat, 7 Nov 2015 16:01:20 -0700 Subject: [PATCH] Disable throttling in test windows via WebAudio hack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Throttling in test windows is annoying when tests run interactively, and *seems* to cause issues with animation frames not firing even in headless tests, though it’s difficult to fully confirm since this issue is intermittent. --- src/initialize-test-window.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/initialize-test-window.coffee b/src/initialize-test-window.coffee index f33cca09d..72a071fb6 100644 --- a/src/initialize-test-window.coffee +++ b/src/initialize-test-window.coffee @@ -57,6 +57,12 @@ module.exports = ({blobStore}) -> document.title = "Spec Suite" + # Avoid throttling of test window by playing silence + context = new AudioContext() + source = context.createBufferSource() + source.connect(context.destination) + source.start(0) + testRunner = require(testRunnerPath) legacyTestRunner = require(legacyTestRunnerPath) buildDefaultApplicationDelegate = -> new ApplicationDelegate()