Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'linux' && os_version == '24.04' && processor == 'x86_64' && display == 'x11' && asan
- Manifest: dom/media/webrtc/tests/mochitests/mochitest.toml
<!DOCTYPE HTML>
<html>
<head>
<title>Test the pref media.cubeb.force_sample_rate</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<body>
<script class="testbody" type="text/javascript">
const WEIRD_SAMPLE_RATE = 44101;
SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({"set": [
["media.cubeb.force_sample_rate", WEIRD_SAMPLE_RATE]
]}).then(function() {
var ac = new AudioContext();
is(ac.sampleRate, WEIRD_SAMPLE_RATE, "Forced sample-rate set successfully.");
SimpleTest.finish();
});
</script>
</pre>
</body>