1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <link rel="stylesheet" href="../fast/js/resources/js-test-style.css"/>
5 <script src="resources/audio-testing.js"></script>
6 <script src="../fast/js/resources/js-test-pre.js"></script>
7 <title>Test Panner setPanningModel values.</title>
11 <div id="description"></div>
12 <div id="console"></div>
15 description("Test if panningModel can be set and read.");
17 // Test to see if we panningModel is updated when we set it.
19 if (window.layoutTestController) {
20 layoutTestController.dumpAsText();
21 layoutTestController.waitUntilDone();
24 window.jsTestIsAsync = true;
26 var context = new webkitAudioContext();
28 var panner = context.createPanner();
30 // Set the panning model and see if it can be read back
32 panner.panningModel = panner.EQUALPOWER;
33 if (panner.panningModel == 0) {
34 testPassed("Panner set to EQUALPOWER model and read correctly.");
36 testFailed("Panner model set to EQUALPOWER (0) but returned " + panner.panningModel);
40 panner.panningModel = panner.HRTF;
41 if (panner.panningModel == 1) {
42 testPassed("Panner set to HRTF model and read correctly.");
44 testFailed("Panner model set to HRTF (1) but returned " + panner.panningModel);
48 // SOUNDFIELD should throw exception because it is not
49 // currently implemented. (See https://bugs.webkit.org/show_bug.cgi?id=77367)
51 panner.panningModel = panner.SOUNDFIELD;
52 testFailed("Setting panner model to SOUNDFIELD should throw exception because it is not implemented.");
55 testPassed("Setting panner model to SOUNDFIELD correctly throws exception because it is not implemented.");
58 // Other invalid models should throw an exception.
60 panner.panningModel = 99;
61 testFailed("Illegal panner model should throw exception.");
64 testPassed("Illegal panner model correctly throws exception.");
68 testPassed("Panning model tests passed.");
70 testFailed("Panning model tests failed.");
77 successfullyParsed = true;
81 <script src="../fast/js/resources/js-test-post.js"></script>