Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / webaudio / audiochannelmerger-basic.html
blobdcf6547c32ecc6bb21c5b209add5b199402499c7
1 <!DOCTYPE html>
2 <html>
4 <head>
5 <script src="../resources/js-test.js"></script>
6 <script src="resources/compatibility.js"></script>
7 <script src="resources/audio-testing.js"></script>
8 </head>
10 <body>
11 <script>
12 description("Basic tests for ChannelMerger.");
13 window.jsTestIsAsync = true;
15 var audit = Audit.createTaskRunner();
17 // Task: Checking constraints in ChannelMergerNode.
18 audit.defineTask('exceptions-channels', function (done) {
19 var context = new OfflineAudioContext(2, 128, 44100);
20 var merger;
22 Should('context.createChannelMerger()', function () {
23 merger = context.createChannelMerger();
24 }).notThrow();
26 Should('context.createChannelMerger(0)', function () {
27 merger = context.createChannelMerger(0);
28 }).throw('IndexSizeError');
30 Should('context.createChannelMerger(32)', function () {
31 merger = context.createChannelMerger(32);
32 }).notThrow();
34 // Can't create a channel merger with 33 channels because the audio
35 // context has a 32-channel-limit in Chrome.
36 Should('context.createChannelMerger(33)', function () {
37 merger = context.createChannelMerger(33);
38 }).throw('IndexSizeError');
40 done();
41 });
43 // Task: checking the channel-related properties have the correct value and
44 // can't be changed.
45 audit.defineTask('exceptions-properties', function (done) {
46 var context = new OfflineAudioContext(2, 128, 44100);
47 var merger = context.createChannelMerger();
49 Should('merger.channelCount', merger.channelCount).beEqualTo(1);
51 Should('merger.channelCount = 3', function () {
52 merger.channelCount = 3;
53 }).throw('InvalidStateError');
55 Should('merger.channelCountMode', merger.channelCountMode).beEqualTo('explicit');
57 Should('merger.channelCountMode = "max"', function () {
58 merger.channelCountMode = 'max';
59 }).throw('InvalidStateError');
61 done();
62 });
64 audit.defineTask('finish', function (done) {
65 finishJSTest();
66 done();
67 });
69 audit.runTasks(
70 'exceptions-channels',
71 'exceptions-properties',
72 'finish'
75 successfullyParsed = true;
76 </script>
77 </body>
79 </html>