Bug 1432761 - check for audioLevel when it is present in mochitest
MozReview-Commit-ID: BhRwEY85wb3
--- a/dom/media/tests/mochitest/test_peerConnection_audioSynchronizationSources.html
+++ b/dom/media/tests/mochitest/test_peerConnection_audioSynchronizationSources.html
@@ -30,17 +30,17 @@
let receivers = [...test.pcRemote.getReceivers(),
...test.pcLocal.getReceivers()];
for (let recv of receivers) {
let syncSources = recv.getSynchronizationSources();
ok(syncSources,
"Receiver has Synchronization sources " + JSON.stringify(syncSources));
is(syncSources.length, 1, "Each receiver has only a single sync source");
let source = recv.getSynchronizationSources()[0];
- ok(source.audioLevel,
+ ok(source.audioLevel !== null,
`Synchronization source has audio level. (${source.audioLevel})`);
ok(source.audioLevel < 128,
`Synchronization source audio level < 128. (${source.audioLevel})`);
ok(source.timestamp,
`Synchronization source has timestamp (${source.timestamp})`);
ok(window.performance.now() + window.performance.timeOrigin -
source.timestamp < 2500, // This large value is used because sometimes
// the testing hardware is _very_ slow