summaryrefslogtreecommitdiffstats
path: root/dom/media/webrtc/tests/mochitests/test_forceSampleRate.html
blob: c5a9820aaa52917719666f3041b8e66e651a064f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE HTML>
<html>
<head>
  <title>Test the pref media.cubeb.force_sample_rate</title>
  <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
  <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>