From 44946573a25c6ef6ca0a7fa34a9b5d9efce3a7cb Mon Sep 17 00:00:00 2001 From: Andreas Pehrson Date: Thu, 1 Feb 2018 19:28:57 +0100 Subject: [PATCH] Bug 1434988 - Make audio loopback mochitest return early without loopback device set up. r=achronop MozReview-Commit-ID: AA05i50qI2A --HG-- extra : rebase_source : 9b5911586741eacd8c8b32b1e291b9d8bd64b709 --- .../mochitest/test_getUserMedia_basicAudio_loopback.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dom/media/tests/mochitest/test_getUserMedia_basicAudio_loopback.html b/dom/media/tests/mochitest/test_getUserMedia_basicAudio_loopback.html index 9a68ff6c95dd..65460a812372 100644 --- a/dom/media/tests/mochitest/test_getUserMedia_basicAudio_loopback.html +++ b/dom/media/tests/mochitest/test_getUserMedia_basicAudio_loopback.html @@ -15,9 +15,12 @@ /** * Run a test to verify the use of LoopbackTone as audio input. */ - scriptsReady - .then(() => FAKE_ENABLED = false) - .then(() => runTestWhenReady( async () => { + scriptsReady.then(() => runTestWhenReady(async () => { + if (!audioDevice) { + todo(false, "No loopback device set by framework. Try --use-test-media-devices"); + return Promise.resolve(); + } + // At this point DefaultLoopbackTone has been instantiated // automatically on frequency TEST_AUDIO_FREQ (440 Hz). Verify // that a tone is detected on that frequency.