blob: f9d6a6f98ac2aa688893aae07dd3503f34f15a25 [file] [log] [blame]
jer.noble@apple.com02b73202018-04-02 15:40:20 +00001<!DOCTYPE html>
2
3<html>
4<head>
5<script src="../resources/js-test.js"></script>
6<script type="text/javascript" src="resources/audio-testing.js"></script>
7</head>
8
9<body>
10<div id="description"></div>
11<div id="console"></div>
12
13<script>
14description('OfflineAudioContexts should not have behavior restrictions.');
15
16var context = null;
17var node = null;
18var calledResumeWithUserGesture = false;
19
20function runTest() {
21 window.jsTestIsAsync = true;
22
23 context = new webkitOfflineAudioContext(2, 1000, 44100);
24
25 if (window.internals)
26 internals.setAudioContextRestrictions(context, 'RequireUserGestureForAudioStart');
27
28 shouldBe('context.state', '"suspended"');
29
30 node = context.createBufferSource();
31 evalAndLog('node.connect(context.destination)');
32 evalAndLog('node.start()');
33 shouldBe('context.state', '"suspended"');
34
35 debug('Calling context.startRendering() without a user gesture');
36 context.startRendering();
37 shouldBe('context.state', '"running"');
38 finishJSTest();
39}
40
41runTest();
42
43</script>
44</body>
45</html>