Bug 1406350 - part1: Update runtest.py to new loopback setup. r?pehrsons
MozReview-Commit-ID: GLB78LWVTHP
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -744,32 +744,36 @@ def findTestMediaDevices(log):
return None
# Feed it a frame of output so it has something to display
subprocess.check_call(['/usr/bin/gst-launch-0.10', 'videotestsrc',
'pattern=green', 'num-buffers=1', '!',
'v4l2sink', 'device=%s' % device])
info['video'] = name
- # Use pactl to see if the PulseAudio module-sine-source module is loaded.
- def sine_source_loaded():
+ # Use pactl to see if the PulseAudio module-null-sink module is loaded.
+ def null_sink_loaded():
o = subprocess.check_output(
['/usr/bin/pactl', 'list', 'short', 'modules'])
- return filter(lambda x: 'module-sine-source' in x, o.splitlines())
-
- if not sine_source_loaded():
- # Load module-sine-source
+ return filter(lambda x: 'module-null-sink' in x, o.splitlines())
+
+ if not null_sink_loaded():
+ # Load module-null-sink
subprocess.check_call(['/usr/bin/pactl', 'load-module',
- 'module-sine-source'])
- if not sine_source_loaded():
- log.error('Couldn\'t load module-sine-source')
+ 'module-null-sink'])
+
+ if not null_sink_loaded():
+ log.error('Couldn\'t load module-null-sink')
return None
+ # Whether it was loaded or not make it the default output
+ subprocess.check_call(['/usr/bin/pacmd', 'set-default-sink', 'null'])
+
# Hardcode the name since it's always the same.
- info['audio'] = 'Sine source at 440 Hz'
+ info['audio'] = 'Monitor of Null Output'
return info
class KeyValueParseError(Exception):
"""error when parsing strings of serialized key-values"""
def __init__(self, msg, errors=()):